How to add default sort in server side proccessing
How to add default sort in server side proccessing
Hi, please tell me how to add default sort in server side proccessing.
I use this script to init.
$('#datatablecategory').DataTable({
"processing": true,
"stateSave": true,
"serverSide": true,
"ajax": "datatable.php",
columns: [
{ data: "$.category_menu" },
{ data: "c.category_name" },
{ data: "c.category_slug" },
{ data: "c.category_view" }
],
"autoWidth": false
});
Now, I want to know how to sort by "c.category_created_date" (for example) if I dont display category_created_date at datatable?
This question has an accepted answers - jump to answer
Answers
order
. The default is column index 0, ascending.Allan
Thanks Allan for your respond.
Now I found the solution, is to set the column into not visible.
And yeah, I use "order" option after that.
Once again. Thanks Allan.