bScrollInfinite + bStateSave + bServerSide = BUG (Fix Provided)
bScrollInfinite + bStateSave + bServerSide = BUG (Fix Provided)
di4bl0s
Posts: 17Questions: 0Answers: 0
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
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
This discussion has been closed.
Replies
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
[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
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
Regards,
Allan