当前位置: 代码迷 >> JavaScript >> jquery的导航页面8(nodeDocPage.jsp续)
  详细解决方案

jquery的导航页面8(nodeDocPage.jsp续)

热度:769   发布时间:2012-11-19 10:18:51.0
jquery的导航页面八(nodeDocPage.jsp续)
    //刷新子节点列表
    function loadChildNodes(node, data) {
        var children = $("div#navi_subnode_div");
        var visibility = "visible";
        children.empty();
       
        var curLevel=parseInt($(node).attr("level"));
        var childNodes;
            childNodes = data.childNodes;
          if (childNodes.length == 0) {
              visibility = "hidden";
          }
       
        var tableNode = $("<table style='table-layout: fixed;' border='0' cellpadding='0' cellspacing='4'></table>");
        var nodeArray = sortSubnodes(childNodes);
       
        for(var i=0;i<nodeArray.length;i++){
              var tr = $("<tr></tr>");
              for(var j=0;j<nodeArray[i].length;j++){
                  if (nodeArray[i][j] != null) {
                      tr.append("<td valign='top' width='18px'><img src='/support/images/NavigationBar/folder.gif'></td><td style='vertical-align: top;'><div class='child_node_cell'><a id='"+nodeArray[i][j].item_id+"' href='#' level='"+nodeArray[i][j].level+"' class='child_nodes_area' onclick='addNavigationItem(this); return false;'>"+nodeArray[i][j].item_name+"</a></div></td>");
                  } else {
                      tr.append("<td valign='top' width='18px'></td><td class='child_node_cell'></td>");
                  }
              }
            tableNode.append(tr);
        }
       
        children.append(tableNode);
       
        if (visibility == "visible") {
        $("#navi_subnode_div").show();
        } else {
        $("#navi_subnode_div").hide();
        }
       
        // 显示文档列表,一定要放在本function的最后执行
        showDocs(node, data, true);

    }
  相关解决方案