DataTables warning: table id=tblData - Requested unknown parameter 'id' for row 0, column 1.
DataTables warning: table id=tblData - Requested unknown parameter 'id' for row 0, column 1.
jadk
Posts: 2Questions: 1Answers: 0
The method getAll() is returning Id and name, but the datatable is displaying this error, in the result image attached you can see that the name displays but the buttons (html) returned from js function are not displaying. Is there something wrong in my code?
Answers
javascript is a case sensitive language. Your data is the keys of
Id
andName
with upper case. But yourcolumns.data
is defined with lower caseid
andname
. Change one of them so the case matches.Kevin
when i changed "data": "name" to "data": "Name" i got the same error but instead of parameter "id" it's parameter "Name" as seen in the image here. The problem is in the id column only because the name was returning correctly when it was in lower case like this "data": "name". Would the problem be something else?
Can you show us the raw JSON that is returned from the server please? You can get the from the browser's network inspector.
Allan