Reputation: 1217
I have following string date column in datatables. I need to sort the table data onload based on the following column
Thank you, Sri
Upvotes: 1
Views: 74
Reputation: 97
This is how you do initial sorting in DataTables:
$(document).ready(function() {
$('#example').DataTable( {
"order": [[ 3, "desc" ]]
} );
} );
There should be a default date sort but here you could find some helpful plugins that will do the job if it is not working as intended:
https://www.datatables.net/plug-ins/sorting/
Upvotes: 1