table_t.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // JavaScript Document
  2. $(function() {
  3. $('#table').bootstrapTable({
  4. method:"post",
  5. url: "json/data.json",
  6. dataType: "json",
  7. pagination: true, //分页
  8. singleSelect: false,
  9. pageList:[10,20,50],
  10. locale:"zh-US", //表格汉化
  11. search: false, //显示搜索框
  12. columns: [
  13. {
  14. checkbox:"true",
  15. field: 'name',
  16. align: 'center',
  17. valign: 'middle'
  18. },
  19. {
  20. title: '状态',
  21. field: 'status',
  22. align: 'center',
  23. valign: 'middle'
  24. },
  25. {
  26. title: '参与人数',
  27. field: 'participationCounts',
  28. align: 'center'
  29. },
  30. {
  31. title: '总人数',
  32. field: 'totalCounts',
  33. align: 'center'
  34. },
  35. {
  36. title: '开始时间',
  37. field: 'startTime',
  38. align: 'center'
  39. },
  40. {
  41. title: '操作',
  42. field: 'id',
  43. align: 'center',
  44. formatter: function (value, row) {
  45. var e = '<a href="#" mce_href="#" onclick="edit(\'' + row.id + '\')">编辑</a> ';
  46. // var d = '<a href="#" mce_href="#" onclick="del(\'' + row.id + '\')">删除</a> ';
  47. return e;
  48. }
  49. }
  50. ]
  51. });
  52. })