1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-28 01:54:15 +01:00

New: "destroy" event - when the table is destroyed the destroy event is now triggered. This is very similar to how aoDestroyCallback worked before, but this brings the implementation into line with the newer callback/events mechanisim used in DataTable

This commit is contained in:
Allan Jardine 2012-04-13 15:26:30 +01:00
parent dc59830454
commit 513d6d5440
3 changed files with 24 additions and 8 deletions

View File

@ -5232,10 +5232,8 @@
/* Flag to note that the table is currently being destroyed - no action should be taken */
oSettings.bDestroying = true;
/* Restore hidden columns */
for ( i=0, iLen=oSettings.aoDestroyCallback.length ; i<iLen ; i++ ) {
oSettings.aoDestroyCallback[i].fn();
}
/* Fire off the destroy callbacks for plug-ins etc */
_fnCallbackFire( oSettings, "aoDestroyCallback", "destroy", [oSettings] );
/* Restore hidden columns */
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
@ -11819,4 +11817,14 @@
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
/**
* Destroy event, fired when the DataTable is destroyed by calling fnDestroy or passing
* the bDestroy:true parameter in the initialisation object. This can be used to remove
* bound events, added DOM nodes, etc.
* @name DataTable#destroy
* @event
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
}(jQuery, window, document, undefined));

View File

@ -246,4 +246,14 @@
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
/**
* Destroy event, fired when the DataTable is destroyed by calling fnDestroy or passing
* the bDestroy:true parameter in the initialisation object. This can be used to remove
* bound events, added DOM nodes, etc.
* @name DataTable#destroy
* @event
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
}(jQuery, window, document, undefined));

View File

@ -459,10 +459,8 @@ this.fnDestroy = function ( bRemove )
/* Flag to note that the table is currently being destroyed - no action should be taken */
oSettings.bDestroying = true;
/* Restore hidden columns */
for ( i=0, iLen=oSettings.aoDestroyCallback.length ; i<iLen ; i++ ) {
oSettings.aoDestroyCallback[i].fn();
}
/* Fire off the destroy callbacks for plug-ins etc */
_fnCallbackFire( oSettings, "aoDestroyCallback", "destroy", [oSettings] );
/* Restore hidden columns */
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )