Reputation: 1
I want to prevent by default sorting in data table.
Below is the code I am using.
$('#tableId').dataTable( {
"bPaginate": true,
"stateSave": true
});
Upvotes: 0
Views: 98
Reputation: 1
$('#tableId').dataTable( {
"bPaginate": true,
"columnDefs": [{ "orderable": false, "targets": '_all' }]
});
Actually it save the state of previous one , after removing state save property its working fine.
Upvotes: 0
Reputation: 121
Have you tried using this : columns.orderable ?
$('#tableId').dataTable( {
"bPaginate": true,
"stateSave": true,
"columnDefs": [{ "orderable": false, "targets": '_all' }]
});
Upvotes: 1