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.
yiyioo
Posts: 1Questions: 0Answers: 0
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);
}
/* 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.