treeeven.htm 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. <title></title>
  5. <script src="../../lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  6. <link href="../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  7. <script src="../../lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  8. <script src="../../lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
  9. <script type="text/javascript">
  10. var manager = null;
  11. $(function ()
  12. {
  13. $("#tree1").ligerTree(
  14. {
  15. url: 'tree.json',
  16. onBeforeExpand: onBeforeExpand,
  17. onExpand: onExpand,
  18. onBeforeCollapse: onBeforeCollapse,
  19. onCollapse: onCollapse,
  20. onBeforeSelect: onBeforeSelect,
  21. onSelect: onSelect,
  22. onCheck: onCheck,
  23. onClick: onClick,
  24. onBeforeCancelSelect: onBeforeCancelSelect,
  25. onCancelSelect: onCancelSelect
  26. });
  27. manager = $("#tree1").ligerGetTreeManager();
  28. });
  29. function onBeforeCancelSelect(note)
  30. {
  31. alert('onBeforeCancelSelect:' + note.data.text);
  32. return true;
  33. }
  34. function onCancelSelect(note)
  35. {
  36. alert('onCancelSelect:' + note.data.text);
  37. }
  38. function onBeforeSelect(note)
  39. {
  40. alert('onBeforeSelect:' + note.data.text);
  41. return true;
  42. }
  43. function onSelect(note)
  44. {
  45. alert('onSelect:' + note.data.text);
  46. }
  47. function onBeforeExpand(note)
  48. {
  49. alert('onBeforeExpand:' + note.data.text);
  50. }
  51. function onExpand(note)
  52. {
  53. alert('onExpand:' + note.data.text);
  54. }
  55. function onBeforeCollapse(note)
  56. {
  57. alert('onBeforeCollapse:' + note.data.text);
  58. }
  59. function onCollapse(note)
  60. {
  61. alert('onCollapse:' + note.data.text);
  62. }
  63. function onCheck(note, checked)
  64. {
  65. alert('onCheck:' + note.data.text + " checked:" + checked);
  66. }
  67. function onClick(note)
  68. {
  69. alert('onClick:' + note.data.text);
  70. }
  71. </script>
  72. </head>
  73. <body style="padding:10px; width:700px;">
  74. <br />
  75. <br />
  76. <ul id="tree1"> </ul>
  77. <div style="display:none">
  78. </div>
  79. </body>
  80. </html>