mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
Dev fix: Loading from an initial draw position was broken
- I had inadvertantly broken the ability to set an initial draw position using `displayStart` or state saving with the small refactoring of _fnDraw and fnDisplayEnd. fnDisplayEnd must be called with settings._iDisplayStart set, which is now done simply by changing the order of calling a little.
This commit is contained in:
parent
b7915d7cf6
commit
ab7e797965
@ -335,8 +335,6 @@ function _fnDraw( oSettings )
|
|||||||
var iOpenRows = oSettings.aoOpenRows.length;
|
var iOpenRows = oSettings.aoOpenRows.length;
|
||||||
var oLang = oSettings.oLanguage;
|
var oLang = oSettings.oLanguage;
|
||||||
var iInitDisplayStart = oSettings.iInitDisplayStart;
|
var iInitDisplayStart = oSettings.iInitDisplayStart;
|
||||||
var iDisplayStart = oSettings._iDisplayStart;
|
|
||||||
var iDisplayEnd = oSettings.fnDisplayEnd();
|
|
||||||
var bServerSide = oSettings.oFeatures.bServerSide;
|
var bServerSide = oSettings.oFeatures.bServerSide;
|
||||||
var aiDisplay = oSettings.aiDisplay;
|
var aiDisplay = oSettings.aiDisplay;
|
||||||
|
|
||||||
@ -345,7 +343,7 @@ function _fnDraw( oSettings )
|
|||||||
/* Check and see if we have an initial draw position from state saving */
|
/* Check and see if we have an initial draw position from state saving */
|
||||||
if ( iInitDisplayStart !== undefined && iInitDisplayStart !== -1 )
|
if ( iInitDisplayStart !== undefined && iInitDisplayStart !== -1 )
|
||||||
{
|
{
|
||||||
iDisplayStart = bServerSide ?
|
oSettings._iDisplayStart = bServerSide ?
|
||||||
iInitDisplayStart :
|
iInitDisplayStart :
|
||||||
iInitDisplayStart >= oSettings.fnRecordsDisplay() ?
|
iInitDisplayStart >= oSettings.fnRecordsDisplay() ?
|
||||||
0 :
|
0 :
|
||||||
@ -354,6 +352,9 @@ function _fnDraw( oSettings )
|
|||||||
oSettings.iInitDisplayStart = -1;
|
oSettings.iInitDisplayStart = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var iDisplayStart = oSettings._iDisplayStart;
|
||||||
|
var iDisplayEnd = oSettings.fnDisplayEnd();
|
||||||
|
|
||||||
/* Server-side processing draw intercept */
|
/* Server-side processing draw intercept */
|
||||||
if ( oSettings.bDeferLoading )
|
if ( oSettings.bDeferLoading )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user