remember.html 2.6 KB

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