async.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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=iso-8859-1"/>
  5. <title>jQuery async treeview</title>
  6. <link rel="stylesheet" href="../jquery.treeview.css" />
  7. <link rel="stylesheet" href="../red-treeview.css" />
  8. <link rel="stylesheet" href="screen.css" />
  9. <script src="../lib/jquery.js" type="text/javascript"></script>
  10. <script src="../lib/jquery.cookie.js" type="text/javascript"></script>
  11. <script src="../jquery.treeview.js" type="text/javascript"></script>
  12. <script src="../jquery.treeview.edit.js" type="text/javascript"></script>
  13. <script src="../jquery.treeview.async.js" type="text/javascript"></script>
  14. <script type="text/javascript">
  15. function initTrees() {
  16. $("#black").treeview({
  17. url: "source.php"
  18. })
  19. $("#mixed").treeview({
  20. url: "source.php",
  21. // add some additional, dynamic data and request with POST
  22. ajax: {
  23. data: {
  24. "additional": function() {
  25. return "yeah: " + new Date;
  26. }
  27. },
  28. type: "post"
  29. }
  30. });
  31. }
  32. $(document).ready(function(){
  33. initTrees();
  34. $("#refresh").click(function() {
  35. $("#black").empty();
  36. $("#mixed").empty();
  37. initTrees();
  38. });
  39. });
  40. </script>
  41. </head>
  42. <body>
  43. <h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/">jQuery Treeview Plugin</a> Demo</h1>
  44. <div id="main">
  45. <ul>
  46. <li><a href=".">Main Demo</a></li>
  47. <li><a href="source.phps">Server component used</a></li>
  48. </ul>
  49. <h4>Lazy-loading tree</h4>
  50. <ul id="black">
  51. </ul>
  52. <h4>Mixed pre and lazy-loading</h4>
  53. <ul id="mixed">
  54. <li><span>Item 1</span>
  55. <ul>
  56. <li><span>Item 1.0</span>
  57. <ul>
  58. <li><span>Item 1.0.0</span></li>
  59. </ul>
  60. </li>
  61. <li><span>Item 1.1</span></li>
  62. </ul>
  63. </li>
  64. <li id="36" class="hasChildren">
  65. <span>Item 2</span>
  66. <ul>
  67. <li><span class="placeholder">&nbsp;</span></li>
  68. </ul>
  69. </li>
  70. <li>
  71. <span>Item 3</span>
  72. </li>
  73. </ul>
  74. <button id="refresh">Refresh both Trees</button>
  75. </div>
  76. </body></html>