dataTable定时刷新数据

偏执的太偏执、 2021-10-08 06:26 684阅读 0赞

70

  1. <div class="col-lg-12 col-md-12 col-xs-12">
  2. <div class="x_content">
  3. <div class="row top_tiles">
  4. <table id="machkanbandataTable" class="col-md-12 col-sm-12 col-xs-12">
  5. <thead>
  6. <tr>
  7. <th></th>
  8. </tr>
  9. </thead>
  10. <tbody id="machkanbanContent" class="">
  11. </tbody>
  12. </table>
  13. </div>
  14. </div>
  15. </div>
  16. var tables;
  17. $(document).ready(function(){
  18. createTable();
  19. });
  20. function machKanbanMethod1233(){
  21. tables.destroy();//销毁原先的table
  22. createTable();
  23. }
  24. function createTable(){
  25. var code='';
  26. var machCode='';
  27. $.ajax({
  28. //代码部分........
  29. });
  30. tables= $('#machkanbandataTable').DataTable( {
  31. destroy:true,
  32. "bSort": false,//禁止分页
  33. "iDisplayLength": 25, //jquery datatable默认每页显示多少条数据
  34. language: {
  35. "sProcessing": "处理中...",
  36. "sLengthMenu": "显示 _MENU_ 台结果",
  37. "sZeroRecords": "没有匹配结果",
  38. "sInfo": "显示第 _START_ 至 _END_ 台,共 _TOTAL_ 台",
  39. "sInfoEmpty": "显示第 0 至 0 台结果,共 0 台",
  40. "sInfoFiltered": "(由 _MAX_ 台结果过滤)",
  41. "sInfoPostFix": "",
  42. "sSearch": "查询:",
  43. "sUrl": "",
  44. "sEmptyTable": "数据为空",
  45. "sLoadingRecords": "载入中...",
  46. "sInfoThousands": ",",
  47. "oPaginate": {
  48. "sFirst": "首页",
  49. "sPrevious": "上页",
  50. "sNext": "下页",
  51. "sLast": "末页"
  52. },
  53. "oAria": {
  54. "sSortAscending": ": 以升序排列此列",
  55. "sSortDescending": ": 以降序排列此列"
  56. }
  57. }
  58. } )
  59. timeouts.push(setTimeout("machKanbanMethod1233()",10000))//注十秒刷新数据
  60. }

发表评论

表情:
评论列表 (有 0 条评论,684人围观)

还没有评论,来说两句吧...

相关阅读