destroyEditor
Editor instance destroyed.
Please note - this property requires the Editor extension for DataTables.
Description
This event is triggered on the document whenever an Editor instance is destroyed (i.e. through the use of destroy()). It can be used to maintain a pool of Editor instances available on your page, if that is required for your application.
Note that unlike the other Editor events, do not listen for it on the Editor instance (since you don't know what that is!), but rather on the document element. The Editor instance that was created is passed in as the second parameter to the callback function.
Type
function( e, inst )
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | e | No | |
Event object | |||
| 2 | inst | No | |
The Editor instance that was destroyed. | |||
Example
Maintaining a collection of existing Editor instances:
const pool = [];
$(document)
.on('initEditor', function (e, editor) {
pool.push(editor);
})
.on('destroyEditor', function (e, editor) {
let idx = pool.indexOf(editor);
if (idx >= 0) {
pool.splice(idx, 1);
}
});Related
The following options are directly related and may also be useful in your application development.