set bStateSave to true,but can't get value from para "iDisplayStart" in some condition.

set bStateSave to true,but can't get value from para "iDisplayStart" in some condition.

yiyiooyiyioo Posts: 1Questions: 0Answers: 0
edited September 2012 in Bug reports
Source code in jquery.dataTables.js(lines 3571):

/* Copy the master data into the draw array and re-draw */
if (oSettings.oFeatures.bFilter) {
/* _fnFilter() will redraw the table for us */
_fnFilterComplete(oSettings, oSettings.oPreviousSearch, 1);
}
else {
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
oSettings._iDisplayStart = 0; /* reset display back to page 0 */
_fnCalculateEnd(oSettings);
_fnDraw(oSettings);
}

//*******So, when bFilter is false,oSettings._iDisplayStart will set to 0 everytime .********//

fixed:

/* Copy the master data into the draw array and re-draw */
if (oSettings.oFeatures.bFilter) {
/* _fnFilter() will redraw the table for us */
_fnFilterComplete(oSettings, oSettings.oPreviousSearch, 1);
}
else {
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
if (oSettings.oFeatures.bStateSave) {
oSettings._iDisplayStart = 0; /* reset display back to page 0 */
}
_fnCalculateEnd(oSettings);
_fnDraw(oSettings);
}
This discussion has been closed.