0

I use with option serverSide: true. I see it in the ajax request body that it sends the default ordering option, which is the first column and ASC always.

order[0][column]=0&order[0][dir]=asc

Is there a way to configure this and change default order setting?

3
  • 1
    Have you checked out this page? Commented Jul 11, 2019 at 11:14
  • @U25lYWt5IEJhc3RhcmQg works! I can accept if you answer the question Commented Jul 11, 2019 at 11:28
  • 1
    thanks, it is a kind of advice that isn't worth an answer Commented Jul 11, 2019 at 11:43

2 Answers 2

3

In you DataTable Configuration inside javascript you can specify that with help of,

 "order": [[1, "asc"]],

I hope this will help you! Thanks!

Sign up to request clarification or add additional context in comments.

Comments

3

Solution is below in table settings:

    { ....
    serverSide: true,
    order: [ 4, 'desc' ]
    ajax: { ...

More details on available options:

https://datatables.net/reference/option

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.