The onBeforeEventRender event handler is called for each item in the data source (events.list) during loading. You can use it to make adjustments to the data item before it is processed and displayed by the JavaScript Scheduler component.
This event is the main event customization tool.
When setting custom HTML using args.data.html, make sure that all input values are properly escaped to prevent XSS attacks.
DayPilot.Scheduler.onBeforeEventRender(args)
args.data - event data (a shallow copy of the original object, with start and end converted to DayPilot.Date)In builds 8.1.1794 and earlier, the event data object is accessible as args.e.
Scheduler config:
const dp = new DayPilot.Scheduler("dp", {
onBeforeEventRender: (args) => {
const text = DayPilot.Util.escapeHtml(args.data.text);
const start = args.data.start.toString("h:mm tt");
const end = args.data.end.toString("h:mm tt");
args.data.html = `${text} (${start} - ${end})`;
args.data.cssClass = "test";
}
});
dp.init();