Datatable Sorting Not Working
Datatable Sorting Not Working
vijaynailbiter
Posts: 6Questions: 3Answers: 0
Guys,
I am using jquery data table with server side processing. It's working fine with normal searching and all. but it's not sorting the data properly.. data can't sort.
tableobj = $('#datatable').dataTable({
sAjaxSource: 'ajax url',
aaSorting: [[ 0, false ],[ 1, "desc" ]],
bProcessing: true,
bServerSide: true,
iDisplayLength: '100',
aoColumns: [{
'targets': 0,
'searchable':false,
'orderable':false,
'className': 'dt-body-center',
'render': function (data, type, full, meta){
if($("#checkall").is(":checked")){
return '<label><input checked="checked" type="checkbox" name="check[]" value="' + $('<div/>').text(data).html() + '"></label>';
}
else {
return '<label><input type="checkbox" name="checkbox[]" value="' + $('<div/>').text(data).html() + '"></label>';
}
}
},null,
null,
null,
null
],
processing : true,
fnDrawCallback: function() {
var oSettings = this.fnSettings();
var iTotalRecords = oSettings.fnRecordsTotal();
$("#total_count").html(iTotalRecords);
},
rowCallback: function(row, data, dataIndex){
if($.inArray(data[0], rows_selected) !== -1){
$(row).find('input[type="checkbox"]').prop('checked', true);
$(row).addClass('selected');
}
}
});
Can you guys help me out to resolve this issue.
Thanks
This discussion has been closed.
Answers
I am using serverSide Processing
Ehhhh try to remove "'orderable':false,"
Yes but this is for single collumn not for all.
Why your other columns are null ? You should set some datas. I'll give you an example :