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().
DayPilot.Modal.onShow(args)args.root (HTMLElement) - the root <div> element that wraps the content
args.modal (DayPilot.Modal) - reference to the modal dialog instance
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().
const modal = new DayPilot.Modal({
onShow: (args) => {
args.root.classList.add("custom-modal-content");
},
// ...
});
modal.showHtml("<div>Hello</div>");Availability of this API item in DayPilot editions:
| Lite | Pro | |
|---|---|---|
| DayPilot for JavaScript |
Lite args missing: modal