remember.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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"></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. rememberSelected: true,
  27. columns: [{
  28. field: 'state',
  29. checkbox: true
  30. },
  31. {
  32. field : 'userId',
  33. title : '用户ID'
  34. },
  35. {
  36. field : 'userCode',
  37. title : '用户编号'
  38. },
  39. {
  40. field : 'userName',
  41. title : '用户姓名'
  42. },
  43. {
  44. field : 'userPhone',
  45. title : '用户手机'
  46. },
  47. {
  48. field : 'userEmail',
  49. title : '用户邮箱'
  50. },
  51. {
  52. field : 'userBalance',
  53. title : '用户余额'
  54. },
  55. {
  56. field: 'status',
  57. title: '用户状态',
  58. align: 'center',
  59. formatter: function(value, row, index) {
  60. return $.table.selectDictLabel(datas, value);
  61. }
  62. },
  63. {
  64. title: '操作',
  65. align: 'center',
  66. formatter: function(value, row, index) {
  67. var actions = [];
  68. actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
  69. actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
  70. return actions.join('');
  71. }
  72. }]
  73. };
  74. $.table.init(options);
  75. });
  76. // 选中数据
  77. function checkItem(){
  78. // var arrays = $.table.selectColumns("userId");
  79. var arrays = $.table.selectColumns("userCode");
  80. alert(arrays);
  81. }
  82. </script>
  83. </body>
  84. </html>