在根節(jié)點下增加一個子節(jié)點: var tree = document.all[‘TreeView1‘]; var node = tree.createTreeNode() ; tree.add(node); node.setAttribute( "text", "aaaa");
在當前節(jié)點下增加一個子節(jié)點: var tree = document.all[‘TreeView1‘]; var node = tree.createTreeNode() ; var parentNode = tree.getTreeNode( tree.clickedNodeIndex); parentNode.add(node); node.setAttribute( "text", "aaaa");