DayPilot.Modal.onShow

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 content

  • args.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

DayPilot.Modal.showHtml()

DayPilot.Modal.onClose

DayPilot.Modal Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript

Lite args missing: modal