The onClose event handler fires when the dialog is about to close. Call args.preventDefault() to cancel the closing.
Declaration
DayPilot.Modal.onClose(args)Parameters
args.backgroundClick(boolean) -trueif the modal is closing because of a click on the background<div>args.result- custom parameter passed to close()args.preventDefault()- cancels the closing
Notes
Use this handler to intercept the close request before the dialog is closed. The args.result value is the same object supplied to close().
Example
const modal = new DayPilot.Modal({
onClose: (args) => {
if (!args.result) {
args.preventDefault();
}
},
// ...
});
modal.showHtml("Hello");See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot