DTREE如何認一個目錄節點打開一個URL
方法及其簡單,見dtree.js的標準函數function(pNode),第107行:java代碼: |
// Creates the tree structure dTree.prototype.addNode = function(pNode) { var str = ''; var n=0; if (this.config.inOrder) n = pNode._ai; for (n; n<this.aNodes.length; n++) { if (this.aNodes[n].pid == pNode.id) { var cn = this.aNodes[n]; cn._p = pNode; cn._ai = n; this.setCS(cn); if (!cn.target && this.config.target) cn.target = this.config.target; if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id); [color=red]//注意下面的語句:[/color] if (!this.config.folderLinks && cn._hc) cn.url = null; [color=darkred]//如果想讓一個目錄節點也能夠打開一個URL則把上面的這句話關掉。 //if (!this.config.folderLinks && cn._hc) cn.url = null;[/color] if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) { cn._is = true; this.selectedNode = n; this.selectedFound = true; } str += this.node(cn, n); if (cn._ls) break; } } return str; }; |
posted on 2005-12-19 11:17 @家軍 閱讀(876) 評論(0) 編輯 收藏 所屬分類: J2EE技術類