Stuck with "Processing", valid JSON
Stuck with "Processing", valid JSON
stormlifter
Posts: 15Questions: 0Answers: 0
So I checked the JSON in Firebug with JSONLint and it is all okay.
This is for the second page, the first page loads fine, and I know it's getting the first page from server-side because I am monitoring from my app and from firebug. The issue is my app gives it the right response, but it seems like the table won't act on it. Not sure if I messed something up.
[code]
{
"sEcho": 1,
"iTotalRecords": 11,
"iTotalDisplayRecords": 11,
"aaData": [
[
"-0.60",
"2011-10-18 02:20:26"
]
]
}
[/code]
I have this for my JS
[code]
$('.dataTable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bDeferRender": true,
"bFilter": false,
"sAjaxSource": "/home/obj_list/",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push({'name':'obj','value':'Transaction'})
aoData.push({'name':'fields','value':'amount,date'});
//console.log(aoData);
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
});
[/code]
I'm not quite sure what's wrong right now. Let me know if you know.
This is for the second page, the first page loads fine, and I know it's getting the first page from server-side because I am monitoring from my app and from firebug. The issue is my app gives it the right response, but it seems like the table won't act on it. Not sure if I messed something up.
[code]
{
"sEcho": 1,
"iTotalRecords": 11,
"iTotalDisplayRecords": 11,
"aaData": [
[
"-0.60",
"2011-10-18 02:20:26"
]
]
}
[/code]
I have this for my JS
[code]
$('.dataTable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bDeferRender": true,
"bFilter": false,
"sAjaxSource": "/home/obj_list/",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push({'name':'obj','value':'Transaction'})
aoData.push({'name':'fields','value':'amount,date'});
//console.log(aoData);
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
});
[/code]
I'm not quite sure what's wrong right now. Let me know if you know.
This discussion has been closed.
Replies
Allan
If you are sure you haven't caused an error and really want to send the "processing" away, you can call .hide() on the DIV holding the "processing" message.
either:
$("#"+table_id+"_processing").hide(); // get by ID
or:
$(".dataTables_processing").hide(); // get by class name
The strange thing is it gets the first response without any issues and loads that, it's just updating that seems broken.