Progress Bar for Ajax Server Side DataTable

Progress Bar for Ajax Server Side DataTable

zeddzedd Posts: 3Questions: 0Answers: 0
edited April 2013 in General
Hi All,

I am fairly new to datatables. I am making a reporting plugin for an open source application, and am using data tables to display the data.

I tried initially to just display all the data, but it was a record set of over 50k. I therefore did it as an ajax server side processing table. And that cut down the sped from about 50 secs to 15 secs. But its still 15 secs, and thats a long time, especially for every single request for pagination buttons, search boxes etc etc...

I want to display a progress bar so the client knows that the report is actually doing something, and not just hanging, cuz the client does not want a static loading bar or spinner, he wants to know that the report is loading or doing something.

I have php code that will do a progress bar, but it is based on this class http://vancewalsh.com/php/

But the problem here is, because of the specific way I have to return the data, in the json array object format, I don't know how to make data tables work with this example.


Any help would really be appreciated.
Zedd

Replies

  • allanallan Posts: 63,520Questions: 1Answers: 10,473 Site admin
    edited April 2013
    15 seconds for a server-side response is exceptionally slow. It should be around 300mS tops. Have you tries to optimise your SQL queries with EXPLAIN?

    > But the problem here is, because of the specific way I have to return the data, in the json array object format, I don't know how to make data tables work with this example.

    You can use also any data format with DataTables using mData - http://datatables.net/blog/Extended_data_source_options_with_DataTables

    Allan
  • zeddzedd Posts: 3Questions: 0Answers: 0
    so thats actually fine, i can return extra stuff in the object, but now i realize i actually have a different problem.

    the way the above progress bar works, is it echos the progress every time i update the progress. And that will break the code for the data tables.

    Is there a way to tell the datatables to ignore all data returned from the server until the final and last object, which has all the data is returned?
  • allanallan Posts: 63,520Questions: 1Answers: 10,473 Site admin
    Not built in, but you can write your own Ajax control using the fnServerData option which would allow you to do that.

    Allan
  • zeddzedd Posts: 3Questions: 0Answers: 0
    im looking at source code and trying to figure out how to do this, but am struggling.. could you perhaps help me with a short example of doing this please?
  • allanallan Posts: 63,520Questions: 1Answers: 10,473 Site admin
    Sorry, I'm fully booked for contract work at the moment. It would be next month before I could take any additional freelance work on.

    Allan
This discussion has been closed.