DataTables警告:表ID =已提交-Ajax错误。欲了解更多 有关此错误的信息,请参见http://datatables.net/tn/7
我有2个数据表,当我尝试在两个表上应用serverSide:true时,遇到了以上错误,它们同时加载。
第一个数据表
$('#submitted').DataTable({
"language": {
"emptyTable": "No orders with this status"
},
processing: true,
serverSide: true,
ajax: {
url: '/Orders/SubmittedList',
dataSrc: function (d) {
var response = d;
if (typeof d.response != 'undefined') {
response = d.response;
}
return response.data;
},
start: 0,
length: 10,
draw: 1
},columns: [
{ targets: 0, data: 'jobNumber' },
{ targets: 1, data: 'podiatrist' },
{ targets: 2, data: 'clinic' },
{ targets: 3, data: 'subject' },
{ targets: 4, data: 'type' },
{ targets: 5, data: 'orderDate' },
{ targets: 6, data: 'etsDate' },
{ targets: 7, data: 'status' },
{
targets: 8,
data: 'orderID',
render: function (data, type, row, meta) {
return "<a href='/Orders/Prescription?orderId=" + data + "' class='btn btn-outline-secondary btn-sm'>View</a>";
}
}
],columnDefs : [
{
targets: 1,
visible: showHideAdmin
},
{
targets: 4,
visible: showHideAdminType
}
]
});
第二个数据表
$('#completed').DataTable({
"language": {
"emptyTable": "No orders with this status"
},
processing: true,
serverSide: true,
ajax: {
url: '/Orders/CompletedList',
dataSrc: function (d) {
var response = d;
if (typeof d.response != 'undefined') {
response = d.response;
}
return response.data;
},
start: 0,
length: 10,
draw: 1
},columns: [
{ targets: 0, data: 'jobNumber' },
{ targets: 1, data: 'podiatrist' },
{ targets: 2, data: 'clinic' },
{ targets: 3, data: 'subject' },
{ targets: 4, data: 'extremity' },
{ targets: 5, data: 'orderDate' },
{
targets: 6,
data: 'orderID',
render: function (data, type, row, meta) {
return "<a href='/Orders/Prescription?orderId=" + data + "' class='btn btn-outline-secondary btn-sm'>View</a>";
}
}
],columnDefs : [
{
targets: 1,
visible: showHideAdmin
}
]
});
我搜索了很多关于它的文章,但仍然没有运气。我希望有人可以帮助我。
谢谢。
答案 0 :(得分:0)
我弄清楚了,我检查了开发人员工具,查询字符串很长,然后将其添加到web.config中,效果很好。
<requestLimits maxQueryString="32768" />