Tree 能在
- 元素里定义,此标记可以定义为叶节点和子节点。下面是一个示例: 1.
-
3. Folder 4.
- 5.
-
6. Sub Folder 1 7.
- 8.
-
9. File 11 10.
11. -
12. File 12 13.
14. -
15. File 13 16.
17.
19. -
-
20. File 2 21.
22. -
23. File 3 24.
25.
27. -
-
28. File21 29.
30.
- 2.
Tree 也可以在一个空的
- 元素里定义。 1.
树数据的格式(Tree data format)
每个节点可以包含下列特性:
? id:节点的 id,它对于加载远程数据很重要。
? text:显示的节点文字。
? state:节点状态, 'open' 或 'closed',默认是 'open'。当设为 'closed' 时,此节点有子节点,
并且将从远程站点加载它们。
? checked:指示节点是否被选中。 Indicate whether the node is checked selected.
? attributes:给一个节点追加的自定义属性。
? children:定义了一些子节点的节点数组。
示例: 1. [{ 2. \:1,
3. \:\, 4. \:\, 5. \:[{ 6. \:\, 7. \:true 8. },{
9. \:\, 10. \:\, 11. \:{
12. \:\, 13. \:100 14. }, 15. \:[{ 16. \:\, 17. \:true 18. },{ 19. \: 8,
20. \:\, 21. \:\ 22. }] 23. }] 24. },{
25. \:\, 26. \:\, 27. \:[{
28. \:\ 29. },{ 30. \:\ 31. }] 32. }]
特性 名称 类型 说明 默认值 url string 获取远程数据的 URL 。 null method string 获取数据的 http method 。 post animate boolean 定义当节点展开折叠时是否显示动画效果。 false checkbox boolean 定义是否在每个节点前边显示 checkbox 。 false cascadeCheck boolean 定义是否级联检查。 true onlyLeafCheck boolean 定义是否只在叶节点前显示 checkbox 。 false dnd boolean 定义是否启用拖放。 false data array 加载的节点数据。 null 事件
很多事件的回调函数需要 'node' 函数,它包含下列特性:
? id:绑定到节点的标识值。
? text:显示的文字。
? checked:是否节点被选中。
? attributes:绑定到节点的自定义属性。
? target:目标的 DOM 对象。
jQuery EasyUI API 中文文档
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)