resizable.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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="col-sm-12 select-table table-bordered">
  10. <table id="bootstrap-table" data-resizable="true"></table>
  11. </div>
  12. </div>
  13. </div>
  14. <div th:include="include :: footer"></div>
  15. <th:block th:include="include :: bootstrap-table-resizable-js" />
  16. <script th:inline="javascript">
  17. var prefix = ctx + "demo/table";
  18. var datas = [[${@dict.getType('sys_normal_disable')}]];
  19. $(function() {
  20. var options = {
  21. url: prefix + "/list",
  22. showSearch: false,
  23. showRefresh: false,
  24. showToggle: false,
  25. showColumns: false,
  26. columns: [{
  27. checkbox: true
  28. },
  29. {
  30. field : 'userId',
  31. title : '用户ID'
  32. },
  33. {
  34. field : 'userCode',
  35. title : '用户编号'
  36. },
  37. {
  38. field : 'userName',
  39. title : '用户姓名'
  40. },
  41. {
  42. field : 'userPhone',
  43. title : '用户手机'
  44. },
  45. {
  46. field : 'userEmail',
  47. title : '用户邮箱'
  48. },
  49. {
  50. field : 'userBalance',
  51. title : '用户余额'
  52. },
  53. {
  54. field: 'status',
  55. title: '用户状态',
  56. align: 'center',
  57. formatter: function(value, row, index) {
  58. return $.table.selectDictLabel(datas, value);
  59. }
  60. },
  61. {
  62. title: '操作',
  63. align: 'center',
  64. formatter: function(value, row, index) {
  65. var actions = [];
  66. actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
  67. actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
  68. return actions.join('');
  69. }
  70. }]
  71. };
  72. $.table.init(options);
  73. });
  74. </script>
  75. </body>
  76. </html>