Sort descending does not work
Sort descending does not work
My table sorts correctly the first time I click on any column, which sorts it into ascending order. Clicking on any column a second time causes no JSON data to be returned. Does anyone know how to correct this?
The default sort order of the table is ascending on the first column. If I change the default order to descending, I get no JSON data when the table is initialized. It seems like asking for descending order is the problem.
I'm using PHP/MySql on my server.
This question has an accepted answers - jump to answer
Answers
do you have serverSide: true? if so, the server is responsible for sorting, not datatables.
Problem solved - it was some bad data stored in the database. Any situation like sorting or flitering that brought up the offending row caused datatables to not output any JSON. It would have been nice to get some kind of diagnostic message or something, but I eventually located the bad row through brute force.
Good to hear you got it fixed.
What code were you using to get the data from the database? I'm not sure why it wouldn't have been giving an error.
Allan