1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

Fix #168 - fnInitComplete should give json as second parameter as well

- When server-side processing is enabled, fnInitComplete will now be
  passed a second parameter, the json returned from the server for that
  first draw, matching the Ajax data source with client-side processing
  option.
This commit is contained in:
Allan Jardine 2013-03-27 09:25:55 +00:00
parent baa16632ec
commit 5a0c1f5ac6
4 changed files with 14 additions and 20 deletions

View File

@ -1575,15 +1575,6 @@
oSettings.bSorted = false;
oSettings.bFiltered = false;
oSettings.bDrawing = false;
if ( oSettings.oFeatures.bServerSide )
{
_fnProcessingDisplay( oSettings, false );
if ( !oSettings._bInitComplete )
{
_fnInitComplete( oSettings );
}
}
}
@ -2121,6 +2112,12 @@
oSettings.bAjaxDataGet = false;
_fnDraw( oSettings );
if ( ! oSettings._bInitComplete )
{
_fnInitComplete( oSettings, json );
}
oSettings.bAjaxDataGet = true;
_fnProcessingDisplay( oSettings, false );
}
@ -2759,7 +2756,7 @@
return;
}
/* Server-side processing initialisation complete is done at the end of _fnDraw */
/* Server-side processing init complete is done by _fnAjaxUpdateDraw */
if ( !oSettings.oFeatures.bServerSide )
{
_fnProcessingDisplay( oSettings, false );

View File

@ -237,6 +237,12 @@ function _fnAjaxUpdateDraw ( oSettings, json )
oSettings.bAjaxDataGet = false;
_fnDraw( oSettings );
if ( ! oSettings._bInitComplete )
{
_fnInitComplete( oSettings, json );
}
oSettings.bAjaxDataGet = true;
_fnProcessingDisplay( oSettings, false );
}

View File

@ -490,15 +490,6 @@ function _fnDraw( oSettings )
oSettings.bSorted = false;
oSettings.bFiltered = false;
oSettings.bDrawing = false;
if ( oSettings.oFeatures.bServerSide )
{
_fnProcessingDisplay( oSettings, false );
if ( !oSettings._bInitComplete )
{
_fnInitComplete( oSettings );
}
}
}

View File

@ -98,7 +98,7 @@ function _fnInitialise ( oSettings )
return;
}
/* Server-side processing initialisation complete is done at the end of _fnDraw */
/* Server-side processing init complete is done by _fnAjaxUpdateDraw */
if ( !oSettings.oFeatures.bServerSide )
{
_fnProcessingDisplay( oSettings, false );