orderSequence option globally for the table, not for columns
orderSequence option globally for the table, not for columns
brianjaikens-msl
Posts: 6Questions: 2Answers: 0
Hi can we have a "orderSequence" that acts on the whole table please?
I'm having to add this to every column for every table in all our portals. Because the 3 state sort is now the default.
It would have been better to have to enable the 3 state and default to 2 state ('asc', 'desc') as that is the original default behaviour. Out testers keep reporting this as an issue.
Answers
Two options:
columnDefs
with the_all
target.DataTable.defaults.column.orderSequence
.v2 was the time to introduce a few changes to the defaults.
deferRender
has also been abled by default now. The list of changes is available here, although I see I missed theorderSequence
part. Apologies - I'll fix that.Allan
I've just committed the following which will be included on the site when I next deploy it (tomorrow):
Order sequence
When ordering columns by clicking on their header element, in v1 it would simply toggle between ascending and descending ordering for the columns (controllable with the
columns.orderSequence
option). DataTables 2 introduces a new option to this parameter, an empty string value which represents no ordering. The default has been updated to make use of this and the ordering sequence that is applied when clicking the header cell is now:It will repeat that sequence indefinitely as the column header is clicked. As before, it can be controlled using the
columns.orderSequence
option, and if you wish to restore the default DataTables 1.x behaviour you can do so by setting the default:Allan
This is wonderful Allan. Thank you for the clarification and the speed of reply.
Excellent! Just what was needed. Thank you.