Stuck with "Processing", valid JSON

Stuck with "Processing", valid JSON

stormlifterstormlifter Posts: 15Questions: 0Answers: 0
edited October 2011 in General
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.

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    If you look in the console in Firebug of Inspector, is there a Javascript error?

    Allan
  • stormlifterstormlifter Posts: 15Questions: 0Answers: 0
    No I cannot see any Javascript errors.
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    edited October 2011
    Occassionally I get stuck with "processing" by stepping on the toes of another routine that would have cleared it.

    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
  • stormlifterstormlifter Posts: 15Questions: 0Answers: 0
    Well the data behind it isn't updating so I don't think it's working right, so hiding it wouldn't really fix the issue. Whatever it is DataTables isn't using the response data.
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    check the debugger. not much else I can tell you.
  • stormlifterstormlifter Posts: 15Questions: 0Answers: 0
    edited October 2011
    I mean the debugger is empty. I'm terribly confused myself. It just shows successful POST to the URL and the proper response and that response is valid JSON.

    The strange thing is it gets the first response without any issues and loads that, it's just updating that seems broken.
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    add debug comments here and there, see when and where it breaks. trace the code.
This discussion has been closed.