datatables ajax post请求 延迟显示

$('#resourceList').dataTable({
					 "aLengthMenu": [
					                    [10, 15, 20, -1],
					                    [10, 15, 20,30] // change per page values here
					                ],
			         "iDisplayLength": 10,
			         "ajax": {
			             "url": "resource/systemCheck.do",
			             "type": "POST",
			             "data":data
			         },
			         "sPaginationType": "bootstrap",
			         "bLengthChange": true,//改变每页显示数据数量
			         "bAutoWidth": false,//启用或禁用自动列宽度的计算。
			         "bFilter" : true,
			         "bDestroy" : true,
			         "bServerSide" : false,
			         "bSortClasses" : false,
			         "bSort" : false,
			         "bProcessing": true,
			         "oLanguage": {
			        	 "sProcessing": "正在加载中......",
			             "sLengthMenu": "每页显示: _MENU_",
			             "sZeroRecords": "对不起,查询不到相关数据!",
			             "sEmptyTable": "表中无数据存在!",
			             "sInfo": "当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录",
			             "sInfoFiltered": "数据表中共为 _MAX_ 条记录",
			             "sSearch": "搜索:",
			             "oPaginate": {
			                 "sFirst": "首页",
			                 "sPrevious": "上一页",
			                 "sNext": "下一页",
			                 "sLast": "末页"
			             }
			        },
			         "aoColumns": [
			               { "sClass": "center","mDataProp":"resultMsg", "sTitle": "检查项","sWidth": "12%"},
						   { "sClass": "center ","mDataProp":"resultKey", "sTitle": "结果","sWidth": "12%",
			            	   "mRender":function(data,type,row){
			            		   var html,tpl = '<span style="color:{0};">{1}</span>'
			            		   if("Noncompliance" == data){
			            			   html = tpl.format("#F00","不合规"); 
			            		   }else if("Compliance" == data){
			            			   html = tpl.format("#0F0","合规");
			            		   }
			            		   return html;
			            	   }},
			               { "sClass": "center","mDataProp":"resultKey",  "sTitle": "操作" ,"sWidth": "10%",
								"mRender" : function(data, type, row) {
									var html = "<span title='修正' id='edituserbutton"+data+"'  onclick=\"$.resource.correctCheck(this)\" style='width: 20px; height: 20px; background: url(img/common/edit01.png) no-repeat center; display:inline-block;'></span>"
									return html;
								}},   
					],
					"fnDrawCallback" : function(oSettings) {
		
					}
				});

猜你喜欢

转载自blog.csdn.net/c1052981766/article/details/79911868