Bug in server side processing

Bug in server side processing

ebadenesebadenes Posts: 6Questions: 0Answers: 0
edited April 2009 in Bug reports
Hi,

We are experiencing a bug on the server side in which we see iTotalRecords not using the data properly.

In mi copy of jquery.dataTables.js i change:
in lines 2209 and 2218
replace('_TOTAL_',oSettings.fnRecordsDisplay())+
by
replace('_TOTAL_',oSettings.fnRecordsTotal())+

And in line 258
var iPages = parseInt( (oSettings.fnRecordsDisplay()-1) / oSettings._iDisplayLength, 10 ) + 1;
by
var iPages = parseInt( (oSettings.fnRecordsTotal()-1) / oSettings._iDisplayLength, 10 ) + 1;

Is this correct?

Would it be possible to preload several pages so we don't need to access the server continuously?

Thanks

Replies

  • allanallan Posts: 57,229Questions: 1Answers: 9,111 Site admin
    Hi ebadenes,

    Thanks for your post - but I'm not sure I quite agree with your change - there certainly is a bug in this area (and I've just re-released 1.5 beta 7 to address this) but not quite as you describe - the issue was that the fnRecords*() functions weren't being used everywhere that they should be for the information display

    - fnRecordsDisplay() - used for number of records which can be displayed (after filtering etc)
    - fnRecordsTotal() - used for the total records that could be shown

    So I think your change might have a small bug when using filtering.

    Regarding the preloading of several pages, this is indeed possible (although not yet written!) and would probably be best done through a custom server read function which will cache data as required. One thing to watch here though is that you then enter the realm of pipelining, and you would have to clear the pipeline whenever an operation such as sorting or filtering is performed.

    Hope this helps,
    Allan
  • ebadenesebadenes Posts: 6Questions: 0Answers: 0
    Hi Allan

    It seems that using this latest patch doesn't solve the paginator problem. Still not working here.
    Listing seems to be solved, but pagination still not.
  • allanallan Posts: 57,229Questions: 1Answers: 9,111 Site admin
    Hi ebadenes,

    In what regard is it not working? If you have a look at my demo for server-side processing it appears to be working correctly (unless I am missing something): http://datatables.net/1.5-beta/examples/data_sources/server_side.html

    Allan
  • ebadenesebadenes Posts: 6Questions: 0Answers: 0
    Hi
    In my code, i'm use full_numbers in sPaginationType, and only display 1 page number.
  • ebadenesebadenes Posts: 6Questions: 0Answers: 0
    Hi Allan

    After reviewing my code, i have found a bug in it. I have changed it and now it's working flawlessly.

    Thanks a lot!
  • allanallan Posts: 57,229Questions: 1Answers: 9,111 Site admin
    Hi ebadenes,

    One bug each - sounds fair :-)

    Good to hear you got it sorted.

    Allan
  • allanallan Posts: 57,229Questions: 1Answers: 9,111 Site admin
    Hi ebadenes,

    You might be interested in this example I've put together for pipelining of server-side processing / pagination: http://datatables.net/1.5-beta/examples/server_side/pipeline.html . It will basically cache information about pages after (or before) the one which is currently displayed - thus reducing Ajax calls to the server. Of course, the pipeline must be cleared for other interactions such as filtering or sorting - but it's all a trade off :-)

    Regards,
    Allan
This discussion has been closed.