Sort descending does not work

Sort descending does not work

MitchmasterMitchmaster Posts: 2Questions: 1Answers: 1

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

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    do you have serverSide: true? if so, the server is responsible for sorting, not datatables.

  • MitchmasterMitchmaster Posts: 2Questions: 1Answers: 1
    Answer ✓

    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.

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    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

This discussion has been closed.