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

Merge pull request #83 from kycook/patch2

Only restore hidden columns if table is not being removed from DOM
This commit is contained in:
Allan Jardine 2012-08-22 00:58:20 -07:00
commit e83488ab56

View File

@ -482,7 +482,9 @@ this.fnDestroy = function ( bRemove )
/* Fire off the destroy callbacks for plug-ins etc */
_fnCallbackFire( oSettings, "aoDestroyCallback", "destroy", [oSettings] );
/* Restore hidden columns */
/* If the table is not being removed, restore the hidden columns */
if ( !bRemove )
{
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
{
if ( oSettings.aoColumns[i].bVisible === false )
@ -490,6 +492,7 @@ this.fnDestroy = function ( bRemove )
this.fnSetColumnVis( i, true );
}
}
}
/* Blitz all DT events */
$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');