Reputation: 1863
I am using jQuery DataTable Plugin for tables. I get sorted records from database and create HTML tables but jQuery datatable plugin resort it to first column.
For Example, I have following table.
Person( name, birthdate, memberSince )
I get records from database sorted by memberSince but jQuery datatable plugin resort it by name(first column in html table).
I just want that datatable plugin should not sort it initialy.
Thanks
Upvotes: 1
Views: 316
Reputation: 11552
You want to look into the aaSorting
option.
Your call dataTable()
call should look something like:
$('#example').dataTable( {
"aaSorting": [[ 2, "asc" ]]
} );
Upvotes: 2