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.

jadkjadk 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

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    javascript is a case sensitive language. Your data is the keys of Id and Name with upper case. But your columns.data is defined with lower case id and name. Change one of them so the case matches.

    Kevin

  • jadkjadk Posts: 2Questions: 1Answers: 0

    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?

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    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

Sign In or Register to comment.