override default sort

override default sort

msumnermsumner Posts: 4Questions: 0Answers: 0
edited August 2013 in General
I am not having luck overriding the default sort - the table is sorting asc on the first column. Here is my initialization code.

oTable = $('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "/cfc/canuhelp.cfc?method=osearch&returnformat=json",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "OU", "value": "o" } );
},
"sAjaxDataProp": "DATA",
"aoColumnDefs": [
{ "asSorting": [ "desc" ], "aTargets": [6] }
]
});

Replies

  • msumnermsumner Posts: 4Questions: 0Answers: 0
    I kept tinkering and applied this

    oTable.fnSort( [ [6,'desc'] ] );

    to force the 7th column to be sorted descending.

    so which is best practice trying to use the column definitions or using the function?
This discussion has been closed.