Sorting in serverside
Sorting in serverside
sriram3k
Posts: 1Questions: 0Answers: 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=";
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.
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.
This discussion has been closed.
Replies
Allan