Functions
add()
Adds a node to the tree.
Can only be called before the tree is drawn.
id, pid and name are required .
Parameters
| Name | Type | Description |
|---|---|---|
| id | Number | Unique identity number. |
| pid | Number | Number refering to the parent node. The value for the root node has to be -1. |
| name | String | Text label for the node. |
| url | String | Url for the node. |
| title | String | Title for the node. |
| target | String | Target for the node. |
| icon | String | Image file to use as the icon. Uses default if not specified. |
| iconOpen | String | Image file to use as the open icon. Uses default if not specified. |
| open | Boolean | Is the node open. |
openAll()
Opens all the nodes.
Can be called before and after the tree is drawn.
openTo()
Opens the tree to a certain node and can also select the node.
Can only be called after the tree is drawn.
Configuration
| Variable | Type | Default | Description |
|---|---|---|---|
| target | String | true | Target for all the nodes. |
| folderLinks | Boolean | true | Should folders be links. |
| useSelection | Boolean | true | Nodes can be selected(highlighted). |
| useCookies | Boolean | true | The tree uses cookies to rember it's state. |
| useLines | Boolean | true | Tree is drawn with lines. |
| useIcons | Boolean | true | Tree is drawn with icons. |
| useStatusText | Boolean | false | Displays node names in the statusbar instead of the url. |
| closeSameLevel | Boolean | false | Only one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled. |
| inOrder | Boolean | false | If parent nodes are always added before children, setting this to true speeds up the tree. |
本文介绍了一套用于管理树状图节点的API接口,包括添加节点、打开所有节点及定位到特定节点等功能。提供了详细的参数说明及配置选项,帮助开发者更好地理解和使用这些功能。
673

被折叠的 条评论
为什么被折叠?



