order by

order by

jardeljardel Posts: 1Questions: 0Answers: 0

Hello good afternoon!
I would like to when you load the page, the table does not automatically sort the first column. I wanted to load the page , the ordering would be according to the database . How do I change this in the js file?

Replies

  • ThomDThomD Posts: 334Questions: 11Answers: 43

    If you do not want DataTables to change the order that comes from the database, use the ordering option.

    https://datatables.net/reference/option/ordering

  • allanallan Posts: 63,747Questions: 1Answers: 10,509 Site admin

    If you don't want default ordering, set the order option to be an empty array.That will still allow the table to be ordered by the end user, but with no default.

    Allan

This discussion has been closed.