1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-19 12:52:11 +01:00

Update: When Ajax loading data, now automatically ajust column sizing

- Previously you'd need to use initComplete and columns.adjust() to take
  account of the data that was loaded by Ajax. Now this will be done
  automatically. It does mean a few more clock cycles, but I think
  that's a tradeoff that is worth it.
This commit is contained in:
Allan Jardine 2013-07-23 10:17:43 +01:00
parent c750514e98
commit c822eefc4e
2 changed files with 11 additions and 4 deletions

View File

@ -1 +1 @@
9f491c3ae078c42f582c3a7594ee9ca77bf27f28
3b83c09e3756166db61b32453ddd02ce72bd42bb

View File

@ -2677,10 +2677,17 @@
* with client-side processing (optional)
* @memberof DataTable#oApi
*/
function _fnInitComplete ( oSettings, json )
function _fnInitComplete ( settings, json )
{
oSettings._bInitComplete = true;
_fnCallbackFire( oSettings, 'aoInitComplete', 'init', [oSettings, json] );
settings._bInitComplete = true;
// On an Ajax load we now have data and therefore want to apply the column
// sizing
if ( json ) {
_fnAdjustColumnSizing( settings );
}
_fnCallbackFire( settings, 'aoInitComplete', 'init', [settings, json] );
}