index.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <meta charset="utf-8"/>
  2. <link rel="stylesheet" href="css/demo.css"/>
  3. <link rel="stylesheet" href="css/zTreeStyle/zTreeStyle.css"/>
  4. <script src="js/jquery-1.4.4.min.js"></script>
  5. <script src="js/jquery.ztree.core-3.5.min.js"></script>
  6. <script src="js/jquery.ztree.excheck-3.5.js"></script>
  7. <script type="text/javascript">
  8. function select(){
  9. }
  10. var menu_nodes =[
  11. { name:"父节点1 - 展开", open:true,
  12. children: [
  13. { name:"父节点11 - 折叠",
  14. children: [
  15. { name:"叶子节点111"},
  16. { name:"叶子节点112"},
  17. { name:"叶子节点113"},
  18. { name:"叶子节点114"}
  19. ]},
  20. { name:"父节点12 - 折叠",
  21. children: [
  22. { name:"叶子节点121"},
  23. { name:"叶子节点122"},
  24. { name:"叶子节点123"},
  25. { name:"叶子节点124"}
  26. ]},
  27. { name:"父节点13 - 没有子节点", isParent:true}
  28. ]},
  29. { name:"父节点2 - 折叠",
  30. children: [
  31. { name:"父节点21 - 展开", open:true,
  32. children: [
  33. { name:"叶子节点211"},
  34. { name:"叶子节点212"},
  35. { name:"叶子节点213"},
  36. { name:"叶子节点214"}
  37. ]},
  38. { name:"父节点22 - 折叠",
  39. children: [
  40. { name:"叶子节点221"},
  41. { name:"叶子节点222"},
  42. { name:"叶子节点223"},
  43. { name:"叶子节点224"}
  44. ]},
  45. { name:"父节点23 - 折叠",
  46. children: [
  47. { name:"叶子节点231"},
  48. { name:"叶子节点232"},
  49. { name:"叶子节点233"},
  50. { name:"叶子节点234"}
  51. ]}
  52. ]},
  53. { name:"父节点3 - 没有子节点", isParent:true}
  54. ];
  55. var setting = {
  56. view: {
  57. showIcon: function(treeId, treeNode) {
  58. return false;
  59. }
  60. },
  61. data: {
  62. simpleData: {
  63. enable: true
  64. }
  65. },
  66. check : {
  67. enable: true
  68. }
  69. };
  70. $(document).ready(function(){
  71. $.fn.zTree.init($("#treeDemo"), setting, menu_nodes);
  72. });
  73. </script>
  74. <div id="treeDemo" class="ztree"></div>