Is it possible to set the default column to sort once the page loads? I want to use the one datatable call for different tables across my site. Is it possible to add a th
class to achieve this?
I also want to disable sorting on some columns and since i'm looking for the one datatables call to do everything, is there a class i can add to the th that will make it unsortable?
This is my called dataTable script
if (jQuery().dataTable) {
$('#table-list-items').dataTable({
"fnDrawCallback" : function () {
},
"aLengthMenu": [
[10, 15, 25, 50, 100, -1],
[10, 15, 25, 50, 100, "All"]
],
"iDisplayLength": 25,
"oLanguage": {
"sLengthMenu": "_MENU_ Records per page",
"sInfo": "_START_ - _END_ of _TOTAL_",
"sInfoEmpty": "0 - 0 of 0",
"oPaginate": {
"sPrevious": "Prev",
"sNext": "Next"
}
},
"aoColumnDefs": [{
'bSortable': true,
'aTargets': [0]
}]
});
}