The following error is returned to the datatables interface after obtaining data from the background in the datatables project:
Datatables warning: Requested unknown parameter '0' from the data source for row 0
You can add the following settings. The principle is not very clear.
"Aocolumndefs ":[
{
Sdefaultcontent :'',
Atargets: ['_ all']
}
],
VaR otable = $ ("# example"). datatable ({
"Bdeferrender": True,
"Bfilter": false,
"Bdestroy": True,
"Bprocessing": True,
"Bsort": True,
"Bstatesave": false,
// Asynchronous processing is required. Otherwise, the data cannot be sent.
"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": "loading ......",
"Slengthmenu": "_ menu _ records displayed on each page ",
"Szerorecords": "No data! ",
"Semptytable": "No data exists in the table! ",
"SINFO": "currently displayed _ start _ to _ end _ records, total _ records ",
"Sinfoempty": "0 to 0 records are displayed ",
"Sinfofiltered": "A total of _ max _ records in a data table ",
"Opaginate ":{
"Sfirst": "Homepage ",
"Sprevious": "Previous Page ",
"Snext": "Next page ",
"Slast": "last page"
}
}
});
Turn: http://www.cnblogs.com/VincentHome/p/3964798.html
Datatables warning: Requested unknown parameter '0' from the data source for row 0 Error