Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Sorting in serverside

$
0
0
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=<bean:write name="vgroup"/>";
oTable = jQuery('#vehicle-datatable').dataTable( {

"bJQueryUI": true,
"bRetrieve": true,
//"bProcessing": true,
"bServerSide":true,
"bSortable_1": true,
"bStateSave": true,
"sAjaxSource": "<html:rewrite action="/tracking/Vehicle/showPositions-dynamic"/>"+"?"+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.

Viewing all articles
Browse latest Browse all 1816

Trending Articles