turn off automatic date sorting
turn off automatic date sorting

My data needs the lastest date on top instead of the oldest on top. But by initial loading of datatable, it always sort the date from oldest->latest by ignoring my own date ordering. How do I turn off this initial date sorting functionality?
--Ning
--Ning
This discussion has been closed.
Replies
$(document).ready(function() {
$('#example').dataTable( {
"aaSorting": [ ]
} );
} );
An empty array like Steven has will disable initial sorting, or you can reverse the default and put in: [[0,'desc']].
Yet another option is to use asSorting ( http://datatables.net/usage/columns#asSorting ) to set the sorting order priority for your date columns :-)
Regards,
Allan