How to remove shift-key requirement for multicolumn sorting?
How to remove shift-key requirement for multicolumn sorting?
frankyy
Posts: 9Questions: 5Answers: 0
In any multi-column datatables.net table, multi-column sorting normally requires clicking a header to set the initial sort, then using “Shift + left-click“ on another header to add it to the existing sort order. I want to override this behavior so that the “Shift + left-click” functionality works without requiring the Shift key. How can I override this behaviour?
This question has an accepted answers - jump to answer
Answers
With the build in click to sort listener, there is no option to disable that behaviour (this is the code in question). The reason for that is that if it added the next column to the existing sort, there would be no way to order by just the target column on its own!
Two options:
order()to order the table (useordering.handlerto disable the build in listener).Allan