Sorting in serverside

Sorting in serverside

sriram3ksriram3k Posts: 1Questions: 0Answers: 0
edited July 2013 in DataTables 1.9
Hi,
I am doing a serverside request for refreshing the datatable every 10 seconds. I am using bServerSide for getting the data. It's a JSON object to feed the table. My initialisation code is below.

function inittable(){
var params = "vgroup=";
oTable = jQuery('#vehicle-datatable').dataTable( {

"bJQueryUI": true,
"bRetrieve": true,
//"bProcessing": true,
"bServerSide":true,
"bSortable_1": true,
"bStateSave": true,
"sAjaxSource": ""+"?"+params,
"aaSorting": [[ 4, "desc" ]],
"aoColumns": [
{ "mData": "Name","bSortable": true },
{ "mData": "Locations" },
{ "mData": "Speed" },
{ "mData": "LastState" },
{ "mData": "Movement" },
{ "mData": "State" }
]
} );
}
But my sorting is not working when i use bServerSide. I am new to datatables. I know this might be asked many times. I cant a real answer for this question. But when i remove the bServerSide ,sorting and searching works but my refreshing part is not working.
Thanks in advance for the answer.

Replies

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    If you are using server-side processing, then the sorting is done by the serve r(as the name implies). Are you doing the sorting server-side? See: http://datatables.net/usage/server-side

    Allan
This discussion has been closed.