Disable Data Table Automatic Ordering
Disable Data Table Automatic Ordering

I have a table called ActivityLog in that table I have the id and log_date fields among others. Basically is a transaction log. When I load the data to a datatable I try to loaded in reverse order, this means the newer transaction first, but the first column of the table is the id and by default the datatable soft the id in ascending order. How can I tell the datatable that i don't want to order the records automatically. If I want to order the records I will click the heading of the column I want to order manually. Any thoughts
Answers
Use the
order
option and set it toorder: []
to turn off the initial default ordering of the first column.Kevin
You can also set
columns.orderable
false
for that column if you don't want the user to sort by that column.Kevin