dataTable定时刷新数据


<div class="col-lg-12 col-md-12 col-xs-12">
                   <div class="x_content">
                        <div class="row top_tiles">
			             <table id="machkanbandataTable" class="col-md-12 col-sm-12 col-xs-12">
 	                                <thead>
 	                                   <tr>
 	                                      <th></th>
  	                                   </tr>
  	                                </thead>
 	                                <tbody id="machkanbanContent"  class="">
 	                                     
  	                                </tbody>
 	                            </table>
			               </div>
                   </div>
            </div>

var tables;
		 $(document).ready(function(){
			createTable();
		  }); 
		 
		 function machKanbanMethod1233(){ 
			 tables.destroy();//销毁原先的table
			 createTable();
		 } 
 		 function createTable(){
			  var code='';
			  var machCode='';
			  $.ajax({
				  
	              	       //代码部分........
			     
			  });   
			 tables=  $('#machkanbandataTable').DataTable( {
				 	destroy:true,
				 	"bSort": false,//禁止分页
	     	    	"iDisplayLength": 25, //jquery datatable默认每页显示多少条数据
		  		    language: {
		 		        "sProcessing": "处理中...",
		 		        "sLengthMenu": "显示 _MENU_ 台结果",
		 		        "sZeroRecords": "没有匹配结果",
		 		        "sInfo": "显示第 _START_ 至 _END_ 台,共 _TOTAL_ 台",
		 		        "sInfoEmpty": "显示第 0 至 0 台结果,共 0 台",
		 		        "sInfoFiltered": "(由 _MAX_ 台结果过滤)",
		 		        "sInfoPostFix": "",
		 		        "sSearch": "查询:",
		 		        "sUrl": "",
		 		        "sEmptyTable": "数据为空",
		 		        "sLoadingRecords": "载入中...",
		 		        "sInfoThousands": ",",
		 		        "oPaginate": {
		 		            "sFirst": "首页",
		 		            "sPrevious": "上页",
		 		            "sNext": "下页",
		 		            "sLast": "末页"
		 		        },
		 		        "oAria": {
		 		            "sSortAscending": ": 以升序排列此列",
		 		            "sSortDescending": ": 以降序排列此列"
		 		        }
		 		    }
		 		} )
		 	timeouts.push(setTimeout("machKanbanMethod1233()",10000))//注十秒刷新数据
		}


 
 
 
 
 
 
 

                
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值