preClose
Form close event - Triggered before the form is closed (cancellable).
Please note - this property requires the Editor extension for DataTables.
Description
Before a form is closed, this event is fired. It allows the close action to be cancelled by returning false from the function. This can be useful for confirming that the user actually wants to close the display (if they have unsaved changes for example).
This event is cancellable by returning false from the event handler, which will block any further action from happening, leaving the form in its existing state.
Event naming / backwards compatibility note
Prior to Editor 1.3, events were prefixed with the string on and this event was called onPreClose. That event name can still be used, and will function exactly the same way as the event documented here. The new name is used for simplicity and coherence with the event naming conventions in DataTables.
Type
function( e )
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | e | No | |
Event object | |||
Returns:
boolean:
Return false to stop the close from happening. This will leave the form in the same state that it previously was.
Related
The following options are directly related and may also be useful in your application development.