Problem with Server-side processing
Problem with Server-side processing
guzmancarlosal
Posts: 2Questions: 1Answers: 0
Hi all appreciate the help but I am having an issue with my table. I am seeing processing label frozen when I try to sort or paging, and I see that JSON is beeing generates fine,
here is my table setup I know is heavy but I hope you can help me
var dt =$('#mainDataOutputTable').DataTable( {
bFilter:false,
pageLength : 10,
info: false,
columnDefs: [ { orderable: false, targets: [7 ] }],
processing: true,
serverSide: true,
ajax: {
url: 'firstreport_ajax.cfm',
type: 'POST'
},
colReorder: true,
"columns": [
{ "data": "status"},
{ "data": "supervisor"},
{ "data": "type"},
{ "data": "date"},
{ "data": "shift"},
{ "data": "name"},
{ "data": "contract"},
{ "data": "desc"},
{ "data": "status"},
{ "data": "id"} ,
{ "data": "datecreated"}
]
} );
and this is a little bit how JSON file
{ "sEcho":5,
"iTotalRecords": 150,
"iTotalDisplayRecords ": 150,
"aaData": [
{ "status":"90",
"supervisor":"Ahmed",
"type":"t",
"date":"30-Jan-2014",
"shift":"First",
"name":" Anthony",
"contract":"No",
"desc":"test",
"status":"Open",
"id":"1",
"datecreated":"30-Jan-2014"
}
I need to have data assigned to each column because I need the colreorder plugin and the column's value change after a sorting or change page. thanks!
This discussion has been closed.
Answers
I am using 1.10, and severside, so this needs to be added
$.fn.dataTable.ext.legacy.ajax = true;