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

Modified destroy method to only restore hidden columns if the table is not

being removed from DOM
This commit is contained in:
Patrick Cook 2012-08-21 12:43:13 -07:00
parent d62ac092a6
commit 05201c21c4

View File

@ -482,7 +482,9 @@ this.fnDestroy = function ( bRemove )
/* Fire off the destroy callbacks for plug-ins etc */ /* Fire off the destroy callbacks for plug-ins etc */
_fnCallbackFire( oSettings, "aoDestroyCallback", "destroy", [oSettings] ); _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++ ) for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
{ {
if ( oSettings.aoColumns[i].bVisible === false ) if ( oSettings.aoColumns[i].bVisible === false )
@ -490,6 +492,7 @@ this.fnDestroy = function ( bRemove )
this.fnSetColumnVis( i, true ); this.fnSetColumnVis( i, true );
} }
} }
}
/* Blitz all DT events */ /* Blitz all DT events */
$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT'); $(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');