Datatable sort/order

Datatable sort/order

jmaxb1jmaxb1 Posts: 1Questions: 1Answers: 0

Hello. I have some problems. I have 2 datatables with different data. One of them about invoices and the other one about tracking.

In the first one, invoices, I sort them using ORDER BY in the query and it works perfectly. But i just copy and change labels an select data from the query and it doesn't works.. I use buttons plugins too.

Well, at the beginning Datatable works by 1 second but when buttons load it goes back to sort by the first column.

Anyone knows what's happening?

And sorry for my english..

Answers

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,735

    I sort them using ORDER BY in the query and it works perfectly. But i just copy and change labels an select data from the query and it doesn't works.

    Depending on your configuration sorting can happen at the server or the client. If your sorting is at the client then the SQL queries sorting will be changed by Datatables.

    Well, at the beginning Datatable works by 1 second but when buttons load it goes back to sort by the first column.

    Sorry I'm not clear on what your code is doing to offer help.

    Anyone knows what's happening?

    There are many configuration options that can affect how sorting works. Without seeing what you have its near impossible to tell you what the problem is. Please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.