Hello Tobias,
Is it possible to choose the default column that will be sorted?
Thanks in advance.
-Tony J.
Hello Tobias,
Is it possible to choose the default column that will be sorted?
Thanks in advance.
-Tony J.
Hi,
yes, you could either perform an initial sort on the "Edit" screen of the table (so that the table will already be loaded in the sorted state that you want), or you can make the DataTables library sort the table immediately when it is loaded, by adding a "Custom Command" in the "DataTables JavaScript Features" section, like
"aoColumnDefs": [ { "asSorting": [ "desc" ], "aTargets": [ 3 ] } ]
(This would sort the table for column 4 (because of zero-based indexing), in descending order.)
Regards,
Tobias
You must log in to post.