The onBeforeLinkRender event handler fires for each link before it is rendered by the JavaScript Scheduler. You can use it to customize the link appearance.
Declaration
DayPilot.Scheduler.onBeforeLinkRender(args)Parameters
args.data(object) - shallow copy of the source link data object (see also DayPilot.Link.data)args.from(DayPilot.Event) - link source event (read-only)args.to(DayPilot.Event) - link target event (read-only)
Notes
Update the rendered link through args.data. The object is a shallow copy of the original link data, so the handler can adjust the rendered link without changing the source event references exposed as args.from and args.to.
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onBeforeLinkRender: (args) => {
args.data.color = "orange";
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onBeforeLinkRender: (args) => {
args.data.color = "orange";
},
// ...
};React
<DayPilotScheduler
onBeforeLinkRender={onBeforeLinkRender}
{/* ... */}
/>const onBeforeLinkRender = (args) => {
args.data.color = "orange";
};Vue
<DayPilotScheduler
@beforeLinkRender="onBeforeLinkRender"
<!-- ... -->
/>const onBeforeLinkRender = (args) => {
args.data.color = "orange";
};See Also
Links [doc.daypilot.org]
Link Customization [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot