JS树形菜单dtree

<h4 class="func">add()</h4>adds a node to the tree.<br>can only be called before the tree is drawn.
id, pid and name are required.
<h4>parameters</h4><table class="files" border="0"><tbody><tr><th>name</th> <th>type</th> <th>description</th> </tr><tr><td>id</td><td>number</td><td>unique identity number.</td></tr><tr><td>pid</td><td>number</td><td>number refering to the parent node. the value for the root node has to be -1.</td></tr><tr><td>name</td><td>string</td><td>text label for the node.</td></tr><tr><td>url</td><td>string</td><td>url for the node.</td></tr><tr><td>title</td><td>string</td><td>title for the node.</td></tr><tr><td>target</td><td>string</td><td>target for the node.</td></tr><tr><td>icon</td><td>string</td><td>image file to use as the icon. uses default if not specified.</td></tr><tr><td>iconopen</td><td>string</td><td>image file to use as the open icon. uses default if not specified.</td></tr><tr><td>open</td><td>boolean</td><td>is the node open.</td></tr></tbody></table> 
<h4>example</h4><code>mytree.add(1, 0, 'my node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');</code>
<br><a name="openall"></a>
<h4 class="func">openall()</h4>opens all the nodes.<br>can be called before and after the tree is drawn.
<h4>example</h4><code>mytree.openall();</code>
<br><a name="closeall"></a>
<h4 class="func">closeall()</h4>closes all the nodes.<br>can be called before and after the tree is drawn.
<h4>example</h4><code>mytree.closeall();</code>
<br><a name="opento"></a>
<h4 class="func">opento()</h4>opens the tree to a certain node and can also select the node.<br> can only be called after the tree is drawn.
<h4>parameters</h4><table class="files" border="0"><tbody><tr><th>name</th> <th>type</th> <th>description</th> </tr><tr><td>id</td><td>number</td><td>identity number for the node.</td></tr><tr><td>select</td><td>boolean</td><td>should the node be selected.</td></tr></tbody></table><h4>example</h4><code>mytree.opento(4, true);</code>
<a name="configuration"></a>
<h3>configuration</h3><div class="item"> <table class="files" border="0"><tbody><tr><th>variable</th> <th>type</th> <th>default</th> <th>description</th> </tr><tr><td>target</td><td>string</td><td>true</td><td>target for all the nodes.</td></tr><tr><td>folderlinks</td><td>boolean</td><td>true</td><td>should folders be links.</td></tr><tr><td>useselection</td><td>boolean</td><td>true</td><td>nodes can be selected(highlighted).</td></tr><tr><td>usecookies</td><td>boolean</td><td>true</td><td>the tree uses cookies to rember it's state.</td></tr><tr><td>uselines</td><td>boolean</td><td>true</td><td>tree is drawn with lines.</td></tr><tr><td>useicons</td><td>boolean</td><td>true</td><td>tree is drawn with icons.</td></tr><tr><td>usestatustext</td><td>boolean</td><td>false</td><td>displays node names in the statusbar instead of the url.</td></tr><tr><td>closesamelevel</td><td>boolean</td><td>false</td><td>only one node within a parent can be expanded at the same time. openall() and closeall() functions do not work when this is enabled.</td></tr><tr><td>inorder</td><td>boolean</td><td>false</td><td>if parent nodes are always added before children, setting this to true speeds up the tree.</td></tr></tbody></table><h4>example</h4><code>mytree.config.target = "mytarget";</code>
 
 
 
 
 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值