不是简单的传值就行了, 它的显示该文件的类型,创建时间,名称,当然,直接传他的url就能在右边看到该文件夹下的信息,这是系统默认的,但是我要求的是你点击右边的的文件时左边的节点也会相应的变化,如"展开节点或者关闭".
两边要都能进行交互,这是我很郁闷的一件事!

解决方案 »

  1.   

    你把这些信息一并组织,存储,传输,右边取你要的信息。
    lucky around U!
      

  2.   

    这是左边树结构显示的一段代码,大家看看,如果说只是简单的传值就能搞定的话那就好了, 你不可能把这边的代码又全放到那边去吧,右边必须显示当前节点下的子节点信息.
    var Outline=""
    // cycle through each entry in the outline array
    for (var i = 1; i < db.length; i++) {
      var currIndent = db[i].indent           // get the indent level
      var expanded = current.substring(i-1,i) // current state 0或者1 长度为1位数
      var top = db[i].top
      if (top == "") { top="content" }
      // display entry only if it meets one of three criteria
      if ((currIndent == 0 || currIndent <= prevIndentDisplayed || (showMyDaughter == 1 && (currIndent - prevIndentDisplayed == 1)))) {
      Outline += pad(currIndent)//0不需要缩进,其它都自动缩进4个空格
    var mouseOverBgColor= "#1E90FF";
      // Insert the appropriate GIF and HREF
      newitem = "";
      //开始输出
      if (db[i].newitem) { newitem="_new"; }//显示不同的图片
      if (!(db[i].mother)) {//不是父节点
      Outline += "<IMG SRC=\"images/blank.gif\" align='absmiddle' BORDER=0 WIDTH=16 HEIGHT=16><A HREF=\"" + db[i].URL + "\" TARGET=\"" + top + "\" onMouseOver='this.style.backgroundColor=\""+mouseOverBgColor +"\"' onmouseout='this.style.backgroundColor=\"\"' onclick=\"setSelected("+i+");history.go(0)\"><IMG SRC=\"images/closed" + newitem + ".gif\" align='absmiddle' WIDTH=16 HEIGHT=16 BORDER=0>"
        }
      else {//属于父节点
          if (current.substring(i-1,i) == 1) {//节点状态为展开
            Outline += "<A HREF=\"" + db[i].URL + "\" TARGET=\"" + top + "\" onMouseOver='this.style.backgroundColor=\""+
    mouseOverBgColor +"\"'\" onmouseout='this.style.backgroundColor=\"\"' onClick=\"toggle(" + i + ");setSelected("+i+")\">"
            Outline += "<IMG SRC=\"images/minus.gif\" align='absmiddle' WIDTH=16 HEIGHT=16 BORDER=0><IMG SRC=\"images/open" + newitem + ".gif\" WIDTH=16 HEIGHT=16  BORDER=0 align='absmiddle'>"
            }
          else {
        Outline += "<A HREF=\"" + db[i].URL + "\" TARGET=\"" + top + "\" onMouseOver='this.style.backgroundColor=\""+
    mouseOverBgColor +"\"';return true;\" onmouseout='this.style.backgroundColor=\"\"' onClick=\"toggle(" + i + ");setSelected("+i+")\">"
            Outline += "<IMG SRC=\"images/plus.gif\" align='absmiddle' WIDTH=16 HEIGHT=16 BORDER=0><IMG SRC=\"images/closed" + newitem + ".gif\" WIDTH=16 HEIGHT=16  BORDER=0 align='absmiddle'>"      
            }
          }
        Outline += "&nbsp;";
       
        if (db[i].URL == "" || db[i].URL == null) {
          Outline += "</A>"+ db[i].display      // no link, just a listed item//不连接,只显示字符
          }
        else {
    //alert(db[i].selectedOption+"df")
      if (getCurrState("option")==i)
      {
          Outline +="<font color=\"#FF69B4\">" + db[i].display + "</font>" + "</A>"//href
      }
      else
      {
          Outline += db[i].display  + "</A>"//href
      }
          }
    // Bold if at level 0
        if (currIndent == 0) {//如果为根节点 加粗
          Outline = "<b>" + Outline + "</b>"
          }
        Outline += "<BR>"//显示一个节点后进行换行,重新家载下一个节点
      

  3.   

    如果子节点是文件夹的话得显示文件夹图片,就跟资源管理器相似,两边都能交互,但又有不同,我现在是一步步实现该功能,以后需要用到的是webdav,这些节点信息都是从后台获得的,然后对xml进行解析,获得节点信息,目前还不需要做到这一步,所以用的全部是静态的节点,不能动态增加,删除节点.
    这是静态添加节点的方法,存储到数组,然后用for循环显示节点.
    //匹配:dbAdd(父节点[真|假]),菜单名称,地址URL[为空时设置为纯文本],缩进位置[0,1,2,4],目标,新加入的菜单[//1代表是,0代表不是]
    dbAdd( true , "娱乐" , "./sample/娱乐" , 0 , "" , 0,0)
    dbAdd( true, "音乐" , "./sample/娱乐/音乐" , 1 , "" ,0, 0)
    dbAdd( false , "流行歌曲" , "./sample/娱乐/音乐/流行歌曲" , 2 , "", 0,0)
     dbAdd( false , "校园歌曲" , "./sample/娱乐/音乐/校园歌曲" , 2 , "" , 0,0)
      dbAdd( false , "民歌" , "./sample/娱乐/音乐/民歌" , 2 , "" , 0,0)
      dbAdd( false , "FLASH", "./sample/FLASH" , 1 , "" , 0,0)
     // 添加菜单到数组
    var total=1
    db=new Array()
    function dbAdd(mother,display,URL,indent,top,newitem,selectedOption) {
      db[total] = new Object;
      db[total].mother = mother
      db[total].display = display
      db[total].URL = URL
      db[total].indent = indent//缩排,确定节点位置0。1。2
      db[total].top = top
      db[total].newitem = newitem
      db[total].selectedOption=selectedOption
      total++
      }
      

  4.   

    谁能上QQ,杂们在QQ上面能够更好说清楚.很急!