How to replace deprecated aaSorting code to restrict column ordering direction?
How to replace deprecated aaSorting code to restrict column ordering direction?

Link to test case:
http://live.datatables.net/mumosiso/2/edit
Description of problem:
As seen in the above example, I am able to restrict the direction in which columns can be ordered according to a class in the column header. But it's using aaSorting
, which is legacy code for v1.9.
$(document).ready( function () {
var table = $('#example').DataTable( {
order: [ 2, 'desc' ],
columnDefs:[
{
asSorting: ['desc'],
targets: ['desc_only']
},
{
asSorting: ['asc'],
targets: ['asc_only']
}
]
} );
} );
Is there a way to do the same using non-deprecated code for v1.10? I've tried using order
but can't get it working.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You can use
columns.orderSequence
for that,Colin
Thanks Colin. I did a straight swap,
aaSorting
toorderSequence
and it worked.