Is it possible for DT to default sort order to a first sortable column?
Is it possible for DT to default sort order to a first sortable column?
I've just upgraded from 1.9.4 to 1.10.2, and I noticed that I get sort order indicator (triangle icon) on the first column by default, even if first column is configured as non-sortable.
First column on my page contains buttons. Sorting by that column is meaningless.
Here is a "fiddle", note that there is "(asc)" indicator on the first column when table is initialized:
http://live.datatables.net/gowisixe/1
I would prefer DT to sort by first sortable column by default. Is it possible? Is this by design?
This question has an accepted answers - jump to answer
Answers
Currently by design, although I am considering changing it.
As the documentation for
columns.orderable
notes:i.e. it does not effect the ability to change the ordering via the API, and therefore the
order
option.Use the
order
option to specify a default sort.Allan