Search code examples
jquerydatatablesdatatables-1.10

jQuery Datables - have up arrow sort largest first


I'm using Datatables 1.10, and would like the largest values be sorted when the user clicks the up arrow instead of when the user clicks the down arrow. How do I do this? I have tried using orderSequence and order attributes, but I can't get it to work. This is for the "salary" column.

https://jsfiddle.net/tcdotmn2/44/


Solution

  • Use columns.orderSequence to customize order sequence for each column.

    See this example for code and demonstration.

    Sorting occurs when user clicks the heading, arrows are displayed only to indicate sorting order.