Search/Sorting not working when using aoColumns

Search/Sorting not working when using aoColumns

DevMarkDevMark Posts: 1Questions: 0Answers: 0
edited November 2013 in DataTables 1.9
Hello,
All data get from Server Side. When i go to search and sort data, it is always return completely data json from server.(sSearch can POST TO SERVER)
It means that my server can return perfectly. Also means that using fnDraw or fnreload are not solution for me.
If i do not using aoColumns/aoColumnDefs , it can work great.
So what function should i use to fix it?

[code]
var oTable = $('.datatable').dataTable({
"sDom": "<'row'<'col-xs-6'T><'col-xs-6'f>r>t<'row'<'col-xs-6'i><'col-xs-6'p>>",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "list_all",
"aoColumns": [
{"sTitle":"Title", "sClass": "title", "mData":"title", "sType":"string"},
{"sTitle":"au",
"sClass": "no_mobile",
"mData":"lastname",
"sType":"string",
"mRender":function(data, type, row){
return row.lastname + " " + row.firstname;
}
},
{"sTitle":"cate", "sClass": "no_mobile", "mData":"name"},
{"sTitle":"date", "sClass": "no_mobile", "mData":"date_upd"},
{"sTitle":"st", "sClass": "no_mobile", "mData":"status"},
],
"fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
oSettings.jqXHR = $.ajax( {
"dataType": 'JSON',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
},
"oTableTools": {
"sSwfPath": "js/dataTables/ZeroClipboard/swf/copy_csv_xls_pdf.swf",
"sRowSelect": "multi",
"aButtons": [ "select_all", "select_none" ]
}

});
[/code]

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    If you enable server-side processing ( bServerSide ) then you are telling DataTables that the server side script will do all the sorting and filtering. Does `list_all` meet the requirements set out here: http://datatables.net/usage/server-side

    Allan
This discussion has been closed.