怎样实现这样的树,要求内详,分不够再加,急!!!!!!!! missago(宇安) 请贴出网址看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 最好贴出你的数据结构出来,这样大家才好下手。也可以看看http://community.csdn.net/Expert/topic/2978/2978989.xml?temp=.4741022 我是在单击节点时调用javascript关闭和打开的 to:52juanjuan(Fibona)是动态的 function TreeInteractive() { //如果是点击节点 $TmpBaseDN = $_POST["NodeDn"]; $BaseDN = substr($_POST["NodeDn"],0,strlen($_POST["NodeDn"])-2); $QueryType = 1; $sQueryCond = ""; //查询一级目录 EnumObj($sQueryCond,$BaseDN,$QueryType,$ResultSeq); $TmpAr = array(); for ( $i=0 ; $i<count($ResultSeq); $i++ ) { $infoMap = $ResultSeq[$i]; $TmpDn = $infoMap["dn"]; $TmpNodeType = $infoMap["nodetype"]; if ( $TmpDn != "" && $TmpNodeType != "" ) { //如果节点是企业或群组权限文件夹 if ( $TmpNodeType == 0 || $TmpNodeType == 1 || $TmpNodeType == 3 ) { $a = array ( //隐藏节点类型 '0' => $TmpDn."$".$TmpNodeType , '1' => array() ); array_push($TmpAr,$a); } //如果节点是用户或权限节点 elseif ( $TmpNodeType == 2 || $TmpNodeType == 4 ) { array_push($TmpAr,$TmpDn."$".$TmpNodeType); } } next($ResultSeq); } if ( $BaseDN != LDAP_ROOT ) //如果是点击进入 { //从隐藏控件中读取数组编码后的字符串 $TmpStr = $_POST["ArStr"]; //解码 Str2LdapTree($TmpStr,$Tree); //插入数据 AddNode2LdapTree($Tree ,$TmpBaseDN , $TmpAr); //显示树 disptree($Tree); //将新生成的树编码,再存到隐藏控件中 LdapTree2Str($Tree,$ArStr); echo "<INPUT TYPE=\"HIDDEN\" NAME=\"ArStr\" value=\"$ArStr\" >"; } else //第一次进入 { //将新生成的树编码,再存到隐藏控件中 LdapTree2Str($TmpAr,$ArStr); echo "<INPUT TYPE=\"HIDDEN\" NAME=\"ArStr\" value=\"$ArStr\" >"; //显示树 disptree($TmpAr); } } 我也是找了很久,才搞定的,留下E-Mail,我给你发过去。 var mimgpath="../treeimg";var mfonts="style=\"text-decoration:none;font-family: 宋体; font-size: 9pt; color: #000000; \"";var movercolor="#0000FF";var mnormalcolor="#000000";var NC6=(navigator.userAgent.indexOf("Netscape6")>0)?true:false;var IE=(document.all)?true:false;function mOver(id) {if (IE) {eval(id).style.color=movercolor; } else if(NC6){ document.getElementById(id).style.color=movercolor;}}function mOut(id) {if (IE) {eval(id).style.color=mnormalcolor; } else if(NC6){ document.getElementById(id).style.color=mnormalcolor;}}function mFolderExpand($1,$2,pic) { if (IE) { mExpandIE($1,$2,pic) } else if(NC6){ mExpandNC($1,$2,pic) }}function mExpandIE($1,$2,pic) { Expanda = eval($1 + "a"); Expanda.blur() ExpandChild = eval($1 + "Child"); if ($2 != "top") { ExpandTree = eval($1 + "Tree"); ExpandFolder = eval($1 + "Folder"); } if (ExpandChild.style.display == "none") { ExpandChild.style.display = "block"; if ($2 != "top") { if ($2 == "last") { ExpandTree.src = mimgpath+"/Lminus.gif"; } else { ExpandTree.src = mimgpath+"/Tminus.gif"; } ExpandFolder.src = mimgpath+"/openfolder"+pic+".gif"; } else { mmTree.src = mimgpath+"/topopen1.gif"; } }else{ ExpandChild.style.display = "none"; if ($2 != "top") { if ($2 == "last") { ExpandTree.src = mimgpath+"/Lplus.gif"; } else { ExpandTree.src = mimgpath+"/Tplus.gif"; } ExpandFolder.src = mimgpath+"/folder"+pic+".gif"; } else { mmTree.src = mimgpath+"/top1.gif"; } }}function mExpandNC($1,$2,pic) { Expanda = document.getElementById($1 + "a"); Expanda.blur() ExpandChild = document.getElementById($1 + "Child"); if ($2 != "top") { ExpandTree = document.getElementById($1 + "Tree"); ExpandFolder = document.getElementById($1 + "Folder"); } if (ExpandChild.style.display == "none") { ExpandChild.style.display = "block"; if ($2 != "top") { if ($2 == "last") { ExpandTree.src = mimgpath+"/Lminus.gif"; } else { ExpandTree.src = mimgpath+"/Tminus.gif"; } ExpandFolder.src = mimgpath+"/openfolder"+pic+".gif"; } else { document.getElementById("mmTree").src = mimgpath+"/topopen1.gif"; } }else{ ExpandChild.style.display = "none"; if ($2 != "top") { if ($2 == "last") { ExpandTree.src = mimgpath+"/Lplus.gif"; } else { ExpandTree.src = mimgpath+"/Tplus.gif"; } ExpandFolder.src = mimgpath+"/folder"+pic+".gif"; } else {document.getElementById("mmTree").src = mimgpath+"/top1.gif"; } }}到这里时一些公用的函数不必理会 with(document){write("<div ID=\"mmParent\"><a ID=\"mma\" href=\"#\" style=\"text-decoration:none;font-family: 宋体; font-size: 9pt; color: #000000; \" onClick=\"mFolderExpand('mm','top',null)\">");write("<img ID=\"mmTree\" src=\""+mimgpath+"/topopen1.gif\" style=\"margin-right: 5\" align=\"absmiddle\" border=\"0\">");write("<font ID=\"mTitle0\" onmouseover=\"mOver('mTitle0')\" onmouseout=\"mOut('mTitle0')\">工作平台</font></a></div>");write("<div ID=\"mmChild\"><img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"middle\" href=\"khxx/index.htm\" "+mfonts+" title=\"\"><font ID=\"mTitle1\" onmouseover=\"mOver('mTitle1')\" onmouseout=\"mOut('mTitle1')\">基本信息</font></a><br>");write("<img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle2\" onmouseover=\"mOver('mTitle2')\" onmouseout=\"mOut('mTitle2')\">关系信息</font></a><br>");write("<div ID=\"mm1Parent\"><a ID=\"mm1a\" target=\"_self\" href=\"#\" "+mfonts+" onClick=\"mFolderExpand('mm1',null,'1')\" title=\"\">");write("<img ID=\"mm1Tree\" src=\""+mimgpath+"/Tplus.gif\" align=\"absmiddle\" border=\"0\"><img ID=\"mm1Folder\" src=\""+mimgpath+"/folder1.gif\" style=\"margin-right: 5\" align=\"absmiddle\" border=\"0\"><font ID=\"mTitle3\" onmouseover=\"mOver('mTitle3')\" onmouseout=\"mOut('mTitle3')\">财务信息</font></a>");write("</div>");write("<div ID=\"mm1Child\" style=\"display:none;\">");write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle4\" onmouseover=\"mOver('mTitle4')\" onmouseout=\"mOut('mTitle4')\">现金流量表</font></a><br>");write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle5\" onmouseover=\"mOver('mTitle5')\" onmouseout=\"mOut('mTitle5')\">资产负债表</font></a><br>");write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/L.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle6\" onmouseover=\"mOver('mTitle6')\" onmouseout=\"mOut('mTitle6')\">损益表</font></a><br>");write("</div>");write("</div>");}这里是需要修改的地方,好好看一下,别弄混了!如果看不明白,留下你的邮箱,我给你完整的js文件 to:goatherd7807() 邮件收到了,非常感谢不过好像不能实现要求2:一次只装载被单击的节点的下一层节点to:gamegod(京都小子)麻烦你了 [email protected]:lzkd(浪子快刀) 问题解决了一定共享 楼上的,也给我发了份吧,好吗???多谢!刚好要用到[email protected] 跪求:关于双网卡下httpd.conf配置的问题 求解正则匹配HTML标签 网页游戏中的倒计时功能后的程序自动执行是怎么实现的? 迷茫倒不迷茫。只是觉得很苦闷!突然不想碰程序了 请教php如何读取mp3文件头 工作两年多了,准备近期更换工作 急:为什么我的php显示中文时为乱码啊?? PHP中有多少个函数?在线等!!! COPY()能不能把本地文件COPY到远程的机子上??? \x01-\x7f代表什么 选中多个复选框,如何把多个值保存到同一字段当中,每个字段用逗号隔开 我想删除第一条记录,然后在最后一行添加新记录
http://community.csdn.net/Expert/topic/2978/2978989.xml?temp=.4741022
是动态的
{
//如果是点击节点
$TmpBaseDN = $_POST["NodeDn"];
$BaseDN = substr($_POST["NodeDn"],0,strlen($_POST["NodeDn"])-2);
$QueryType = 1;
$sQueryCond = "";
//查询一级目录
EnumObj($sQueryCond,$BaseDN,$QueryType,$ResultSeq);
$TmpAr = array();
for ( $i=0 ; $i<count($ResultSeq); $i++ )
{
$infoMap = $ResultSeq[$i]; $TmpDn = $infoMap["dn"];
$TmpNodeType = $infoMap["nodetype"];
if ( $TmpDn != "" && $TmpNodeType != "" )
{
//如果节点是企业或群组权限文件夹
if ( $TmpNodeType == 0 || $TmpNodeType == 1 || $TmpNodeType == 3 )
{
$a = array
( //隐藏节点类型
'0' => $TmpDn."$".$TmpNodeType ,
'1' => array()
);
array_push($TmpAr,$a);
}
//如果节点是用户或权限节点
elseif ( $TmpNodeType == 2 || $TmpNodeType == 4 )
{
array_push($TmpAr,$TmpDn."$".$TmpNodeType);
}
}
next($ResultSeq);
} if ( $BaseDN != LDAP_ROOT )
//如果是点击进入
{
//从隐藏控件中读取数组编码后的字符串
$TmpStr = $_POST["ArStr"];
//解码
Str2LdapTree($TmpStr,$Tree);
//插入数据
AddNode2LdapTree($Tree ,$TmpBaseDN , $TmpAr);
//显示树
disptree($Tree);
//将新生成的树编码,再存到隐藏控件中
LdapTree2Str($Tree,$ArStr);
echo "<INPUT TYPE=\"HIDDEN\" NAME=\"ArStr\" value=\"$ArStr\" >";
}
else
//第一次进入
{
//将新生成的树编码,再存到隐藏控件中
LdapTree2Str($TmpAr,$ArStr);
echo "<INPUT TYPE=\"HIDDEN\" NAME=\"ArStr\" value=\"$ArStr\" >";
//显示树
disptree($TmpAr);
}
}
var mfonts="style=\"text-decoration:none;font-family: 宋体; font-size: 9pt; color: #000000; \"";
var movercolor="#0000FF";
var mnormalcolor="#000000";
var NC6=(navigator.userAgent.indexOf("Netscape6")>0)?true:false;
var IE=(document.all)?true:false;
function mOver(id) {
if (IE) {eval(id).style.color=movercolor; }
else if(NC6){ document.getElementById(id).style.color=movercolor;}
}
function mOut(id) {
if (IE) {eval(id).style.color=mnormalcolor; }
else if(NC6){ document.getElementById(id).style.color=mnormalcolor;}
}function mFolderExpand($1,$2,pic) {
if (IE) { mExpandIE($1,$2,pic) }
else if(NC6){ mExpandNC($1,$2,pic) }
}function mExpandIE($1,$2,pic) {
Expanda = eval($1 + "a");
Expanda.blur()
ExpandChild = eval($1 + "Child");
if ($2 != "top") {
ExpandTree = eval($1 + "Tree");
ExpandFolder = eval($1 + "Folder");
}
if (ExpandChild.style.display == "none") {
ExpandChild.style.display = "block";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = mimgpath+"/Lminus.gif"; }
else { ExpandTree.src = mimgpath+"/Tminus.gif"; }
ExpandFolder.src = mimgpath+"/openfolder"+pic+".gif";
}
else { mmTree.src = mimgpath+"/topopen1.gif"; }
}else{
ExpandChild.style.display = "none";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = mimgpath+"/Lplus.gif"; }
else { ExpandTree.src = mimgpath+"/Tplus.gif"; }
ExpandFolder.src = mimgpath+"/folder"+pic+".gif";
}
else { mmTree.src = mimgpath+"/top1.gif"; }
}
}
function mExpandNC($1,$2,pic) {
Expanda = document.getElementById($1 + "a");
Expanda.blur()
ExpandChild = document.getElementById($1 + "Child");
if ($2 != "top") {
ExpandTree = document.getElementById($1 + "Tree");
ExpandFolder = document.getElementById($1 + "Folder");
}
if (ExpandChild.style.display == "none") {
ExpandChild.style.display = "block";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = mimgpath+"/Lminus.gif"; }
else { ExpandTree.src = mimgpath+"/Tminus.gif"; }
ExpandFolder.src = mimgpath+"/openfolder"+pic+".gif";
}
else { document.getElementById("mmTree").src = mimgpath+"/topopen1.gif"; }
}else{
ExpandChild.style.display = "none";
if ($2 != "top") {
if ($2 == "last") { ExpandTree.src = mimgpath+"/Lplus.gif"; }
else { ExpandTree.src = mimgpath+"/Tplus.gif"; }
ExpandFolder.src = mimgpath+"/folder"+pic+".gif";
}
else {document.getElementById("mmTree").src = mimgpath+"/top1.gif"; }
}
}
到这里时一些公用的函数不必理会
write("<div ID=\"mmParent\"><a ID=\"mma\" href=\"#\" style=\"text-decoration:none;font-family: 宋体; font-size: 9pt; color: #000000; \" onClick=\"mFolderExpand('mm','top',null)\">");
write("<img ID=\"mmTree\" src=\""+mimgpath+"/topopen1.gif\" style=\"margin-right: 5\" align=\"absmiddle\" border=\"0\">");
write("<font ID=\"mTitle0\" onmouseover=\"mOver('mTitle0')\" onmouseout=\"mOut('mTitle0')\">工作平台</font></a></div>");
write("<div ID=\"mmChild\"><img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"middle\" href=\"khxx/index.htm\" "+mfonts+" title=\"\"><font ID=\"mTitle1\" onmouseover=\"mOver('mTitle1')\" onmouseout=\"mOut('mTitle1')\">基本信息</font></a><br>");
write("<img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle2\" onmouseover=\"mOver('mTitle2')\" onmouseout=\"mOut('mTitle2')\">关系信息</font></a><br>");
write("<div ID=\"mm1Parent\"><a ID=\"mm1a\" target=\"_self\" href=\"#\" "+mfonts+" onClick=\"mFolderExpand('mm1',null,'1')\" title=\"\">");
write("<img ID=\"mm1Tree\" src=\""+mimgpath+"/Tplus.gif\" align=\"absmiddle\" border=\"0\"><img ID=\"mm1Folder\" src=\""+mimgpath+"/folder1.gif\" style=\"margin-right: 5\" align=\"absmiddle\" border=\"0\"><font ID=\"mTitle3\" onmouseover=\"mOver('mTitle3')\" onmouseout=\"mOut('mTitle3')\">财务信息</font></a>");
write("</div>");
write("<div ID=\"mm1Child\" style=\"display:none;\">");
write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle4\" onmouseover=\"mOver('mTitle4')\" onmouseout=\"mOut('mTitle4')\">现金流量表</font></a><br>");
write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/T.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle5\" onmouseover=\"mOver('mTitle5')\" onmouseout=\"mOut('mTitle5')\">资产负债表</font></a><br>");
write("<img src=\""+mimgpath+"/I.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/L.gif\" align=\"absmiddle\" width=\"19\" height=\"20\" border=\"0\"><img src=\""+mimgpath+"/item1.gif\" align=\"absmiddle\" style=\"margin-right: 5\"><a target=\"_self\" href=\"#\" "+mfonts+" title=\"\"><font ID=\"mTitle6\" onmouseover=\"mOver('mTitle6')\" onmouseout=\"mOut('mTitle6')\">损益表</font></a><br>");
write("</div>");
write("</div>");
}
这里是需要修改的地方,好好看一下,别弄混了!如果看不明白,留下你的邮箱,我给你完整的js文件
邮件收到了,非常感谢
不过好像不能实现要求
2:一次只装载被单击的节点的下一层节点to:gamegod(京都小子)
麻烦你了 [email protected]:lzkd(浪子快刀)
问题解决了一定共享
刚好要用到[email protected]