7793f1456f44c215af84dd7562c707f5f4664e1a.svn-base 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>树的基本使用</title>
  6. <!--框架必需start-->
  7. <script type="text/javascript" src="../../libs/js/jquery.js"></script>
  8. <script type="text/javascript" src="../../libs/js/language/cn.js"></script>
  9. <script type="text/javascript" src="../../libs/js/framework.js"></script>
  10. <link href="../../libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  11. <link rel="stylesheet" type="text/css" id="skin" prePath="../../"/>
  12. <link rel="stylesheet" type="text/css" id="customSkin"/>
  13. <!--框架必需end-->
  14. <!--树组件start -->
  15. <script type="text/javascript" src="../../libs/js/tree/ztree/ztree.js"></script>
  16. <link href="../../libs/js/tree/ztree/ztree.css" rel="stylesheet" type="text/css"/>
  17. <!--树组件end -->
  18. </head>
  19. <body>
  20. <div class="box1" style="width: 800px;"><div class="box_topcenter"><div class="box_topleft"><div class="box_topright"></div></div></div><div class="box_middlecenter"><div class="box_middleleft"><div class="box_middleright"><div class="boxContent" style="overflow: visible;">
  21. <fieldset>
  22. <legend>1、基本示例</legend>
  23. <div>
  24. <ul id="tree-1" class="ztree"></ul>
  25. </div>
  26. </fieldset>
  27. <div class="height_15"></div>
  28. </div></div></div></div><div class="box_bottomcenter"><div class="box_bottomleft"><div class="box_bottomright"></div></div></div></div>
  29. <script type="text/javascript">
  30. var nodes1 = [
  31. { id:1, parentId:0, name:"部门1", open: true},
  32. { id:11, parentId:1, name:"员工1"},
  33. { id:12, parentId:1, name:"员工2"},
  34. { id:13, parentId:1, name:"员工3"},
  35. { id:14, parentId:1, name:"员工4"},
  36. { id:15, parentId:1, name:"员工5"},
  37. { id:16, parentId:1, name:"员工6"},
  38. { id:17, parentId:1, name:"员工7"},
  39. { id:18, parentId:1, name:"员工8"},
  40. { id:2, parentId:0, name:"部门2", open: true},
  41. { id:21, parentId:2, name:"员工6"},
  42. { id:22, parentId:2, name:"员工10"},
  43. { id:23, parentId:2, name:"员工11"},
  44. { id:24, parentId:0, name:"部门3(强制显示为父节点样子)", isParent:true}
  45. ];
  46. function initComplete(){
  47. //本地数据源
  48. $.fn.zTree.init($("#tree-1"), {}, nodes1);
  49. }
  50. </script>
  51. </body>
  52. </html>