bScrollInfinite + bStateSave + bServerSide = BUG (Fix Provided)

bScrollInfinite + bStateSave + bServerSide = BUG (Fix Provided)

di4bl0sdi4bl0s Posts: 17Questions: 0Answers: 0
edited March 2011 in Bug reports
Hi Allan,
Fist of all great tool & nice comminity,
The above combination causes a bug that pevents the use of the 3 options together atm,
I think because the infinite option stores in _iDisplayStart the next page to load? (didn't do research here)
the fix I've implemented & tested is the following:
[code]
sValue += '"iStart":'+ (oSettings.oScroll.bInfinite ? oSettings.iDisplayStart : oSettings._iDisplayStart)+',';
sValue += '"iEnd":'+ (oSettings.oScroll.bInfinite ? oSettings.iDisplayEnd : oSettings._iDisplayEnd)+',';
[/code]
line 5875 & 5876
this will cause the Infinite scrolling page to start on top again
Regards,
Jan

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited March 2011
    Hi Jan,

    Very nice - thanks for the fix :-). I'll include this in the next release of DataTables.

    Btw - yes you are right about iDisplayStart - basically the infinite scrolling is really using DataTables' built in paging to work, and just not deleting the previous rows.

    Regards,
    Allan
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Thinking about it, should it not perhaps be:

    [code]
    sValue += '"iStart":'+ (oSettings.oScroll.bInfinite ? 0 : oSettings._iDisplayStart)+',';
    sValue += '"iEnd":'+ (oSettings.oScroll.bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd)+',';
    [/code]
    The parameters oSettings.iDisplayStart and oSettings.iDisplayLength doesn't actually exist.

    Allan
  • di4bl0sdi4bl0s Posts: 17Questions: 0Answers: 0
    Hi Allan,
    You are right, good catch, I've never checked if it existed that thoroughly, been quick searching through the code to find what was going on and where, came across some properties where many of them are set & tried it out. very sloppy work of me! bad boy! BAD!! :)
    anyway, glad to see it fix.

    Jan
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Cool - this will be in 1.8 then :-) Thanks very much for the patch.

    Regards,
    Allan
This discussion has been closed.