码迷,mamicode.com
首页 > 其他好文 > 详细

DataTables warning : Requested unknown parameter '1' from the data source for row 0错误

时间:2014-09-10 19:19:20      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   io   os   java   ar   for   

昨天在做datatables的项目,从后台取得数据后,返回给datatables界面时会报下面的错误:

DataTables warning : Requested unknown parameter ‘1‘ from the data source for row 0 

加上下面的设置就可以了,至于原理还不是很清楚。

"aoColumnDefs": [
{
 sDefaultContent: ‘‘,
 aTargets: [ ‘_all‘ ]
  }
],

var oTable = $("#example").dataTable({
	"bDeferRender" : true,
	"bFilter" : false,
	"bDestroy" : true,
	"bProcessing" : true,
	"bSort" : true,
	"bStateSave" : false,
	// 异步处理必须 否则数据发送不到后来
	"bServerSide" : true,
	"sServerMethod" : "POST",

	"sAjaxSource" : "${basePath}/logInfo/getLogInfo",

	"aoColumns" : [ {
		"bVisible" : true,
		"mData" : "providerName",
		"aTargets" : [ 0 ]
	}, {
		"bVisible" : true,
		"mData" : "propertyName",
		"aTargets" : [ 1 ]
	}, {
		"bVisible" : true,
		"mData" : "roomTypeName",
		"aTargets" : [ 2 ]
	}, {
		"bVisible" : true,
		"mData" : "opMethod",
		"aTargets" : [ 3 ]
	}, {
		"bVisible" : true,
		"mData" : "operatTime",
		"aTargets" : [ 4 ]
	}, {
		"bVisible" : true,
		"mData" : "operator",
		"aTargets" : [ 5 ]
	}, ],
	"aoColumnDefs" : [ {
		sDefaultContent : ‘‘,
		aTargets : [ ‘_all‘ ]
	} ],

	"oLanguage" : {
		"sProcessing" : "正在加载中......",
		"sLengthMenu" : "每页显示 _MENU_ 条记录",
		"sZeroRecords" : "没有数据!",
		"sEmptyTable" : "表中无数据存在!",
		"sInfo" : "当前显示 _START_ 到 _END_ 条,共 _TOTAL_ 条记录",
		"sInfoEmpty" : "显示0到0条记录",
		"sInfoFiltered" : "数据表中共为 _MAX_ 条记录",
		"oPaginate" : {
			"sFirst" : "首页",
			"sPrevious" : "上一页",
			"sNext" : "下一页",
			"sLast" : "末页"
		}
	}

});

DataTables warning : Requested unknown parameter '1' from the data source for row 0错误

标签:des   style   blog   color   io   os   java   ar   for   

原文地址:http://www.cnblogs.com/VincentHome/p/3964798.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!