sZeroRecords - How to initiate

sZeroRecords - How to initiate

TiberianusTiberianus Posts: 2Questions: 0Answers: 0
edited March 2010 in General
Hi Guys & Girls,

Many many thanks for Datatables Allan, it is simply wonderful.

I do however have an issue I'm a little stumped on. I'm using bProcessing and bServerSide to pull loads of data from a mysql database. Everything works as it should apart from when there are no records found (say if on a certain date there is no data).

At the moment It just hangs on "Processing", I'm wondering what datatables looks for in my json to produce the no records found message from sZeroRecords? It may be that in my "tweaking" of datatables I've missed the function that starts sZeroRecords.

Your help would be much appreciate all, many thanks!

Gavin

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Gavin,

    With server-side processing, what DataTables is looking for is an empty array for aaData. So something like:

    [code]
    {
    "sEcho": 3,
    "iTotalRecords": 57,
    "iTotalDisplayRecords": 0,
    "aaData": [ ]
    }
    [/code
    should do it... If you try looking at Firebug on my demo pages when it's in this state, then you will see what is happening live.

    Regards,
    Allan
  • TiberianusTiberianus Posts: 2Questions: 0Answers: 0
    Thanks Allan you're a superstar.
This discussion has been closed.