Default ordering not applying to secondary sorting

Default ordering not applying to secondary sorting

benhtbenht Posts: 1Questions: 1Answers: 0

Hello,

Just upgraded to the latest release, thanks for that :)

Should default column ordering apply to secondary sorting too or is there a different default for that (or have I found a useful but missing feature)?

ie

DataTable.defaults.column.orderSequence = ['asc', 'desc'];
(from https://datatables.net/forums/discussion/78749/ordersequence-option-globally-for-the-table-not-for-columns)

I've set the above which works when clicking on column headings (gives 2 options, asc and desc) but shift click on another column still has 3 options (presumably asc, desc and "" (default)).

Example (from URL above) : https://live.datatables.net/kiyadixe/1/edit

thanks,
Ben

Answers

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin

    Hi Ben,

    Good point - the answer is that when multi-column sorting the third click actually removes the column from the sorting (otherwise there is no way to remove the column from the sort sequence, without just starting over again). So it appears as the same effect, but it actually a different mechnaisim and that is intentional. I'm afraid there is no way to override that without modifying the code. This is where that behaviour is defined.

    Allan

Sign In or Register to comment.