recyclebinjs.stub 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. recyclebin: function () {
  2. // 初始化表格参数配置
  3. Table.api.init({
  4. extend: {
  5. 'dragsort_url': ''
  6. }
  7. });
  8. var table = $("#table");
  9. // 初始化表格
  10. table.bootstrapTable({
  11. url: '{%controllerUrl%}/recyclebin' + location.search,
  12. pk: 'id',
  13. sortName: 'id',
  14. columns: [
  15. [
  16. {checkbox: true},
  17. {field: 'id', title: __('Id')},{%recyclebinTitleJs%}
  18. {
  19. field: '{%deleteTimeField%}',
  20. title: __('Deletetime'),
  21. operate: 'RANGE',
  22. addclass: 'datetimerange',
  23. formatter: Table.api.formatter.datetime
  24. },
  25. {
  26. field: 'operate',
  27. width: '140px',
  28. title: __('Operate'),
  29. table: table,
  30. events: Table.api.events.operate,
  31. buttons: [
  32. {
  33. name: 'Restore',
  34. text: __('Restore'),
  35. classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
  36. icon: 'fa fa-rotate-left',
  37. url: '{%controllerUrl%}/restore',
  38. refresh: true
  39. },
  40. {
  41. name: 'Destroy',
  42. text: __('Destroy'),
  43. classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
  44. icon: 'fa fa-times',
  45. url: '{%controllerUrl%}/destroy',
  46. refresh: true
  47. }
  48. ],
  49. formatter: Table.api.formatter.operate
  50. }
  51. ]
  52. ]
  53. });
  54. // 为表格绑定事件
  55. Table.api.bindevent(table);
  56. },