missago(宇安) 
   请贴出网址看看

解决方案 »

  1.   

    最好贴出你的数据结构出来,这样大家才好下手。也可以看看
    http://community.csdn.net/Expert/topic/2978/2978989.xml?temp=.4741022
      

  2.   

    我是在单击节点时调用javascript关闭和打开的
      

  3.   

    to:52juanjuan(Fibona)
    是动态的
      

  4.   

    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);
            }
        }
      

  5.   

    我也是找了很久,才搞定的,留下E-Mail,我给你发过去。
      

  6.   

    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"; }
    }
    }
    到这里时一些公用的函数不必理会
      

  7.   

    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文件
      

  8.   

    to:goatherd7807() 
    邮件收到了,非常感谢
    不过好像不能实现要求
    2:一次只装载被单击的节点的下一层节点to:gamegod(京都小子)
    麻烦你了 [email protected]:lzkd(浪子快刀) 
    问题解决了一定共享
      

  9.   

    楼上的,也给我发了份吧,好吗???多谢!
    刚好要用到[email protected]