Getting "requested unknown parameter '0' from the data source for row 0 datatable", can't figure out
Getting "requested unknown parameter '0' from the data source for row 0 datatable", can't figure out
Parker3306
Posts: 3Questions: 1Answers: 0
I'm trying to figure out why my data isn't showing up in the DataTable with server side ajax call. My DataTables debugger code is exogeg. Here is my html/js in DataTables live: http://live.datatables.net/gasapela/1/
I've looked over a bunch of forum posts with the same error, but the things listed haven't seemed to fix this particular one. If I need to add something more, please let me know. Thanks for taking a look.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Is posting the code in the comment preferred?
Hi,
Thanks for picking up the priority support option! And also for the debug trace and code.
The issue here is the use of
sName
in the columns - you actually want to use thecolumns.data
property ormData
if you want to use the legacy form.So my suggestion would be to use:
Or in 1.10 style (you might also need to add
$.fn.dataTable.ext.legacy.ajax = true;
if your search code on the server-side is expecting the legacy parameters - just add that line immediately before you create the DataTable):The
sName
(orcolumns.name
in 1.10 style) is really useful only for selectors (column-selector
). I think it can be safely ignored here.Regards,
Allan
This did the trick perfectly. Thank you for the correction!