Sorting

Sorting

krutovdlkrutovdl Posts: 38Questions: 8Answers: 1

Found an issue when clicking on a column sort for the first time the down arrow enables for desc that is fine. Then clicking the sort again enables the up arrow for asc which also fine. Then clicking sort again disables both the up and down arrow when expecting a down arrow to enable that causes issues. How to set datatables so that on the third click the down arrow desc sort is called?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,858Questions: 1Answers: 10,344 Site admin

    There is a description of that change in behaviour from v1 to v2 in the upgrade notes here. It also shows there how to remove the "no sort" state if you don't want it.

    Allan

  • krutovdlkrutovdl Posts: 38Questions: 8Answers: 1

    Is there a way to set this feature globally? Or it must be for every table?

  • allanallan Posts: 62,858Questions: 1Answers: 10,344 Site admin
    Answer ✓

    The example gives sets the global default for DataTables:

    DataTable.defaults.column.orderSequence = ['asc', 'desc'];
    

    Use columns.orderSequence if you want to do it per table / per column.

    Allan

Sign In or Register to comment.