Default sorting with particular column
Default sorting with particular column
I have such snippet, this works well:
[code]aoColumnDefsType = [
{ "sType":"title-numeric", "aTargets":[ 3 ] },
{ "sType":"title-numeric", "aTargets":[ 7 ] },
{ "bSortable":false, "aTargets":[ 0 ] },
{ "bSortable":false, "aTargets":[ 8 ] },
{ "bSortable":false, "aTargets":[ 9 ] },
{ "sClass":"center", "aTargets":[ 2, 3, 4, 5, 6, 7 ] }
];[/code]
[code]"aoColumnDefs":aoColumnDefsType[/code]
When starting table, I want my datatable sorted by 6th column descending autmatically.
I tried this but didn't work. I added following line to "aoColumnDefsType"
Shouldn't I use asSorting for this ?
[code] { "asSorting": [ "desc"], "aTargets": [ 6 ] }[/code]
[code]aoColumnDefsType = [
{ "sType":"title-numeric", "aTargets":[ 3 ] },
{ "sType":"title-numeric", "aTargets":[ 7 ] },
{ "bSortable":false, "aTargets":[ 0 ] },
{ "bSortable":false, "aTargets":[ 8 ] },
{ "bSortable":false, "aTargets":[ 9 ] },
{ "sClass":"center", "aTargets":[ 2, 3, 4, 5, 6, 7 ] }
];[/code]
[code]"aoColumnDefs":aoColumnDefsType[/code]
When starting table, I want my datatable sorted by 6th column descending autmatically.
I tried this but didn't work. I added following line to "aoColumnDefsType"
Shouldn't I use asSorting for this ?
[code] { "asSorting": [ "desc"], "aTargets": [ 6 ] }[/code]
This discussion has been closed.
Replies
Allan