tree.jsp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  5. %>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  7. <html>
  8. <head>
  9. <link href="../ligerui/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <link href="css/all.css" rel="stylesheet" type="text/css" />
  11. <script src="../ligerui/lib/jquery/jquery-1.3.2.min.js"type="text/javascript"></script>
  12. <script src="../ligerui/lib/ligerUI/js/ligerui.min.js"type="text/javascript"></script>
  13. <script src="../ligerui/indexdata.js" type="text/javascript"></script>
  14. <script type="text/javascript">
  15. var tab = null;
  16. var accordion = null;
  17. var tree = null;
  18. $(function() {
  19. //布局
  20. $("#layout1").ligerLayout( {
  21. leftWidth : 190,
  22. height : '100%',
  23. heightDiff : -34,
  24. space : 4,
  25. onHeightChanged : f_heightChanged
  26. });
  27. var height = $(".l-layout-center").height();
  28. //Tab
  29. $("#framecenter").ligerTab( {
  30. height : height
  31. });
  32. //面板
  33. $("#accordion1").ligerAccordion( {
  34. height : height - 24,
  35. speed : null
  36. });
  37. $(".l-link").hover(function() {
  38. $(this).addClass("l-link-over");
  39. }, function() {
  40. $(this).removeClass("l-link-over");
  41. });
  42. //树
  43. $("#tree1").ligerTree( {
  44. data : indexdata,
  45. checkbox : false,
  46. slide : false,
  47. nodeWidth : 120,
  48. attribute : [ 'nodename', 'url' ],
  49. onSelect : function(node) {
  50. if (!node.data.url)
  51. return;
  52. var tabid = $(node.target).attr("tabid");
  53. if (!tabid) {
  54. tabid = new Date().getTime();
  55. $(node.target).attr("tabid", tabid)
  56. }
  57. f_addTab(tabid, node.data.text, node.data.url);
  58. }
  59. });
  60. tab = $("#framecenter").ligerGetTabManager();
  61. accordion = $("#accordion1").ligerGetAccordionManager();
  62. tree = $("#tree1").ligerGetTreeManager();
  63. $("#pageloading").hide();
  64. });
  65. function f_heightChanged(options) {
  66. if (tab)
  67. tab.addHeight(options.diff);
  68. if (accordion && options.middleHeight - 24 > 0)
  69. accordion.setHeight(options.middleHeight - 24);
  70. }
  71. function f_addTab(tabid, text, url) {
  72. tab.addTabItem( {
  73. tabid : tabid,
  74. text : text,
  75. url : url
  76. });
  77. }
  78. </script>
  79. </head>
  80. <body style="padding: 0px; background: #EAEEF5;">
  81. </body>
  82. </html>