depart.jsp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html >
  4. <html>
  5. <head>
  6. <title>菜单集合</title>
  7. <t:base type="jquery,easyui,tools"></t:base>
  8. <script type="text/javascript" charset="UTF-8">
  9. var editRow;
  10. var treegrid;
  11. $(function() {
  12. treegrid=$('#treegrid').treegrid({
  13. url : 'functionController.do?setFunction',
  14. title : '',
  15. fit : true,
  16. fitColumns : true,
  17. nowrap : true,
  18. animate : false,
  19. border : true,
  20. idField : 'id',
  21. treeField : 'text',
  22. frozenColumns : [ [ {
  23. title : 'id',
  24. field : 'id',
  25. width : 50,
  26. hidden : true
  27. }, {
  28. field : 'text',
  29. title : '菜单名称',
  30. width : 200
  31. } ] ],
  32. columns : [ [{
  33. field : 'src',
  34. title : '菜单地址',
  35. width : 200
  36. }, {
  37. field : 'code',
  38. title : '菜单编码',
  39. width : 50
  40. }, {
  41. field : 'parentId',
  42. title : '上级菜单',
  43. width : 200,
  44. formatter : function(value, rowData, rowIndex) {
  45. return rowData.parentText;
  46. }},
  47. {
  48. field : 'parentText',
  49. title : '上级菜单',
  50. width : 80,
  51. hidden : true
  52. } ] ],
  53. onLoadSuccess : function(row, data) {
  54. var t = $(this);
  55. if (data) {
  56. $(data).each(function(index, d) {
  57. if (this.state == 'closed') {
  58. //t.treegrid('expandAll');
  59. }
  60. });
  61. }
  62. }
  63. });
  64. });
  65. </script>
  66. </head>
  67. <body>
  68. <table id="treegrid"></table>
  69. </body>
  70. </html>