How to properly apply datatable to mvc object json data
How to properly apply datatable to mvc object json data
I'm trying to apply datatable to the following type of json data coming from asp.net web core:
Object{ questionID:1,questionType:1,displayText: "Yellow Car",.....}
Object{ questionID:2,questionType:1,displayText: "Blue Car",.....}
Object{ questionID:2,questionType:1,displayText: "Green Car",.....}
I get the error:
DataTables warning table id= QuestionsTable - Requested unkown parameter 0 for row 0.
However the datatable gives me a count of 17 entries but doesn't show any data other than that.
Answers
Looks like you need to use
columns.data
. See the Data docs for details.Kevin
Yeah tried that but didn't help. Still gives the same error..
What exactly does that error mean? I don't understand.
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
The link in the error describes the error and troubleshooting steps:
https://datatables.net/manual/tech-notes/4
Kevin