fixedColumns.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('冻结列')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="btn-group-sm" id="toolbar" role="group">
  10. <a class="btn btn-success">
  11. <i class="fa fa-plus"></i> 新增
  12. </a>
  13. <a class="btn btn-primary single disabled">
  14. <i class="fa fa-edit"></i> 修改
  15. </a>
  16. <a class="btn btn-danger multiple disabled">
  17. <i class="fa fa-remove"></i> 删除
  18. </a>
  19. </div>
  20. <div class="col-sm-12 select-table table-striped">
  21. <table id="bootstrap-table"></table>
  22. </div>
  23. </div>
  24. </div>
  25. <div th:include="include :: footer"></div>
  26. <th:block th:include="include :: bootstrap-table-fixed-columns-js" />
  27. <script th:inline="javascript">
  28. var prefix = ctx + "demo/table";
  29. var datas = [[${@dict.getType('sys_normal_disable')}]];
  30. $(function() {
  31. var options = {
  32. url: prefix + "/list",
  33. showSearch: false,
  34. showRefresh: false,
  35. showToggle: false,
  36. showColumns: false,
  37. fixedColumns: true,
  38. fixedNumber: 3,
  39. fixedRightNumber: 3,
  40. columns: [{
  41. checkbox: true
  42. },
  43. {
  44. field : 'userId',
  45. title : '用户ID'
  46. },
  47. {
  48. field : 'userCode',
  49. title : '用户编号'
  50. },
  51. {
  52. field : 'userName',
  53. title : '用户姓名'
  54. },
  55. {
  56. field : 'userPhone',
  57. title : '用户手机'
  58. },
  59. {
  60. field : 'userEmail',
  61. title : '用户邮箱'
  62. },
  63. {
  64. field : 'userBalance',
  65. title : '用户余额'
  66. },
  67. {
  68. field: 'status',
  69. title: '用户状态',
  70. align: 'center',
  71. formatter: function(value, row, index) {
  72. return $.table.selectDictLabel(datas, value);
  73. }
  74. },
  75. {
  76. field : 'userBalance',
  77. title : '测试1'
  78. },
  79. {
  80. field : 'userBalance',
  81. title : '测试2'
  82. },
  83. {
  84. field : 'userBalance',
  85. title : '测试3'
  86. },
  87. {
  88. field : 'userBalance',
  89. title : '测试4'
  90. },
  91. {
  92. field : 'userBalance',
  93. title : '测试5'
  94. },
  95. {
  96. field : 'userBalance',
  97. title : '测试6'
  98. },
  99. {
  100. field : 'userBalance',
  101. title : '测试7'
  102. },
  103. {
  104. field : 'userBalance',
  105. title : '测试8'
  106. },
  107. {
  108. field : 'userBalance',
  109. title : '测试9'
  110. },
  111. {
  112. field : 'userBalance',
  113. title : '测试10'
  114. },
  115. {
  116. field : 'userBalance',
  117. title : '测试11'
  118. },
  119. {
  120. field : 'userBalance',
  121. title : '测试12'
  122. },
  123. {
  124. field : 'userBalance',
  125. title : '测试13'
  126. },
  127. {
  128. field : 'userBalance',
  129. title : '测试14'
  130. },
  131. {
  132. field : 'userBalance',
  133. title : '测试15'
  134. },
  135. {
  136. field : 'userBalance',
  137. title : '测试16'
  138. }]
  139. };
  140. $.table.init(options);
  141. });
  142. </script>
  143. </body>
  144. </html>