bill1.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {extend name="public/bootstraptable"}
  2. {block name="head"}
  3. {/block}
  4. {block name="content"}
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <table id="table1"></table>
  8. <table id="table2"></table>
  9. </div>
  10. </div>
  11. {/block}
  12. {block name="script"}
  13. <script>
  14. $('#table2').bootstrapTable({
  15. method: "POST",
  16. url: "{:Url('billlist')}",
  17. dataType: "json",
  18. toolbar: '#toolbar', //工具按钮用哪个容器
  19. pagination: true, //是否显示分页(*)
  20. cache: false,
  21. clickToSelect: true,
  22. showRefresh: true, //是否显示刷新按钮
  23. showPaginationSwitch: true, //是否显示选择分页数按钮
  24. pageNumber: 1, //初始化加载第一页,默认第一页
  25. showColumns:true,
  26. pageSize: 5, //每页的记录行数(*)
  27. search: true,
  28. showToggle:true,//是否显示切换视图(table/card)按钮
  29. showFullscreen:true,//是否显示全屏按钮
  30. sortable: true, //是否启用排序
  31. sortOrder: "asc",
  32. columns: [
  33. {checkbox : true},
  34. { field: 'id', title: '编号',sortable:true },
  35. { field: 'title', title: '标题',sortable:true },
  36. { field: 'link_id', title: '关联ID',sortable:true },
  37. { field: 'pm', title: '是否支出',sortable:true },
  38. { field: 'number', title: '明细数字',sortable:true },
  39. { field: 'status', title: '状态',sortable:true },
  40. { field: 'add_time', title: '时间',sortable:true},
  41. { field: 'balance', title: '余额',sortable:true },
  42. { field: 'uid', title: '学生编号',sortable:true },
  43. { field: 'balance', title: '金额' },
  44. { field: 'mark', title: '生日' }
  45. ],
  46. onLoadSuccess: function(){ //加载成功时执行
  47. console.info("加载成功");
  48. },
  49. onLoadError: function(){ //加载失败时执行
  50. console.info("加载数据失败");
  51. }
  52. });
  53. </script>
  54. {/block}