fnSortListener and sorting_asc / sorting_desc classes
fnSortListener and sorting_asc / sorting_desc classes
Hello,
I use fnSortListener to add sorting on a hidden column, what would be the right way to have the sorting classes synced for that element? The callback would not work as the sorting could be modified by clicking on another column too.
Thanks,
Did
I use fnSortListener to add sorting on a hidden column, what would be the right way to have the sorting classes synced for that element? The callback would not work as the sorting could be modified by clicking on another column too.
Thanks,
Did
This discussion has been closed.
Replies
sample code working for me :
[code]
"fnStateSaveCallback": function ( oSettings, sValue ) {
var order = '';
for (var i in oSettings.aaSorting) {
if (oSettings.aaSorting[i][0] == 5) {
order = '_'+oSettings.aaSorting[i][1];
break;
}
}
$('#myId').removeClass().addClass('sorting'+order);
return sValue;
}
[/code]
it adds class 'sorting_asc', 'sorting_desc' or 'sorting' to an element with id 'myId' based on the sorting state of column 5.