The onBeforeEventDomAdd event handler runs before a Scheduler event’s custom DOM content is added. Assign custom content to args.element to replace the event text.

Declaration

DayPilot.Scheduler.onBeforeEventDomAdd(args)

Parameters

  • args.control (DayPilot.Scheduler, read-only): the Scheduler instance.

  • args.e (DayPilot.Event, read-only): the rendered event.

  • args.element: custom DOM element, React element or Vue content supported by the corresponding wrapper.

Notes

Since version 2026.4.7086, custom event content supports floating labels. Scrolling a partially visible event keeps its custom controls and their current state. Store values that must survive event redraws or view changes in application state.

Example

This JavaScript example uses a DOM element and assigns event text safely using textContent.

const dp = new DayPilot.Scheduler("dp", {
  onBeforeEventDomAdd: args => {
    const label = document.createElement("span");
    label.textContent = args.e.text();
    args.element = label;
  }
});
dp.init();

See Also

Floating Events

onBeforeEventDomRemove

Availability

Availability of this API item in DayPilot editions:

ProductLitePro
DayPilot for JavaScript