Requested unknown parameter 'Identifier' from the data source for row 0
Requested unknown parameter 'Identifier' from the data source for row 0
KlausM
Posts: 2Questions: 0Answers: 0
Hi,
I have a problem loading data from an ajax data source into datatables.
DataTables is configured as follows:
[code]
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "ExampleData/AjaxHandler",
[/code]
The AjaxHandler returns data in JSON Format created by this code lines
[code]
var jsonReturn = JsonConvert.SerializeObject(test, Formatting.None);
var jsonObj = Json(new
{
sEcho = 1,
iTotalRecords = 1,
iTotalDisplayRecords = 1,
aaData = jsonReturn
}, JsonRequestBehavior.AllowGet);
return jsonObj;
[/code]
The list test contains only one object with an attribute Identifier of type String.
The JSON data produced looks like [code] aaData=[{"Identifier":"1047911897A"}] [/code].
The columns of the table are configured as follows:
[code]
"aoColumns": [
{ "mData": "Identifier" }
],
[/code]
I think everthing should be fine but when I load the table I get the follwing message:
DataTables warning (table id = 'exampleDataTable'): Requested unknown parameter 'Identifier' from the data source for row 0
I have read different threads but can't get an answer
What I am doing wrong?
Klaus
I have a problem loading data from an ajax data source into datatables.
DataTables is configured as follows:
[code]
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "ExampleData/AjaxHandler",
[/code]
The AjaxHandler returns data in JSON Format created by this code lines
[code]
var jsonReturn = JsonConvert.SerializeObject(test, Formatting.None);
var jsonObj = Json(new
{
sEcho = 1,
iTotalRecords = 1,
iTotalDisplayRecords = 1,
aaData = jsonReturn
}, JsonRequestBehavior.AllowGet);
return jsonObj;
[/code]
The list test contains only one object with an attribute Identifier of type String.
The JSON data produced looks like [code] aaData=[{"Identifier":"1047911897A"}] [/code].
The columns of the table are configured as follows:
[code]
"aoColumns": [
{ "mData": "Identifier" }
],
[/code]
I think everthing should be fine but when I load the table I get the follwing message:
DataTables warning (table id = 'exampleDataTable'): Requested unknown parameter 'Identifier' from the data source for row 0
I have read different threads but can't get an answer
What I am doing wrong?
Klaus
This discussion has been closed.
Replies
Like others, the problem was the JSON format.