Disable Data Table Automatic Ordering

Disable Data Table Automatic Ordering

mvillarrealmvillarreal Posts: 1Questions: 1Answers: 0
edited May 2 in Free community support

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

  • kthorngrenkthorngren Posts: 21,932Questions: 26Answers: 5,067

    Use the order option and set it to order: [] to turn off the initial default ordering of the first column.

    Kevin

  • kthorngrenkthorngren Posts: 21,932Questions: 26Answers: 5,067

    You can also set columns.orderable false for that column if you don't want the user to sort by that column.

    Kevin

Sign In or Register to comment.