The onShow event handler fires before the modal dialog is displayed. It lets you modify the content DOM when the dialog is shown using showHtml().
Declaration
DayPilot.Modal.onShow(args)Parameters
args.root(HTMLElement) - the root<div>element that wraps the contentargs.modal(DayPilot.Modal) - reference to the modal dialog instance
Notes
args.root gives you direct access to the rendered HTML container before it is displayed, which is useful for updating the markup generated by showHtml().
Example
const modal = new DayPilot.Modal({
onShow: (args) => {
args.root.classList.add("custom-modal-content");
},
// ...
});
modal.showHtml("<div>Hello</div>");See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
Lite args missing: modal
DayPilot