Using Server Side Processing using Search and Length = -1
Using Server Side Processing using Search and Length = -1
I'm trying to do a search using server side processing when the table length parameter has been set to show all records (-1). For some reason the table displays no rows when doing this search even though the data comes in from the server as expected.
Here is my debug output for this state: http://debug.datatables.net/avihit
Here is a screenshot of the output: http://nimb.ws/0kLf1Y
I've confirmed that the server side code works correctly for Length = -1 and Search = '' as well as Length != -1 and Search != ''. Does data tables not support showing all records in conjunction with a search criterion?
If it does support all / search, does anyone have any clues as to what the issue could be?
Thanks!
~Noah
This question has an accepted answers - jump to answer
Answers
The server is responding with
aaData
being an object:That is not valid for DataTables. The
data
(oraaData
) property must have an array value - objects are not supported there. The values in the array can be objects, but it must be an array itself.Allan
Allan:
Genius! After php stripped out unwanted rows, it would convert the result set into an object when converting to JSON because keys were non-sequential.
array_values()
to the rescue!Thanks a ton!
Excellent - good to hear that helped :-)
Regards,
Allan