How do I set the column to sort on first load?
How do I set the column to sort on first load?
soroushhakami
Posts: 10Questions: 0Answers: 0
Say that I want my datatable to sort on the second column, 'lastname' in descending order by default the first time the table is loaded. How can i achieve this?
I've already tried this with no success:
[code]"aoColumns": [
{ "mDataProp": "firstname"},
{ "mDataProp": "lastname", "asSorting": [ "desc" ]},
{ "mDataProp": "unit_name" },
{ "mDataProp": "employment_title" },[/code]
I've already tried this with no success:
[code]"aoColumns": [
{ "mDataProp": "firstname"},
{ "mDataProp": "lastname", "asSorting": [ "desc" ]},
{ "mDataProp": "unit_name" },
{ "mDataProp": "employment_title" },[/code]
This discussion has been closed.
Replies
[code]
"aaSorting": [[1, "desc"]]
[/code]