The onLinkClick event handler fires when the user clicks a link in the JavaScript Scheduler component. It runs before the default action.
Declaration
DayPilot.Scheduler.onLinkClick(args)Parameters
args.link(DayPilot.Link): clicked link (read-only)args.control(DayPilot.Scheduler): Scheduler instance (read-only)args.originalEvent(MouseEvent): native mouse event (read-only)args.ctrl,args.meta,args.shift,args.alt(boolean): modifier keys (read-only)args.preventDefault(): cancels the default action andonLinkClicked
Notes
Applies when linkClickHandling is "Enabled" or "Select". In selection mode, the order is onLinkClick, onLinkSelect, onLinkSelected, then onLinkClicked. A canceled selection skips onLinkSelected.
Use this handler when you need to inspect the clicked DayPilot.Link object before the built-in Scheduler link action completes. If you need to react after the default action, use onLinkClicked instead.
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onLinkClick: (args) => {
console.log("Link clicked before default action", args.link);
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onLinkClick: (args) => {
console.log("Link clicked before default action", args.link);
},
// ...
};React
<DayPilotScheduler
onLinkClick={onLinkClick}
/>const onLinkClick = (args) => {
console.log("Link clicked before default action", args.link);
};Vue
<DayPilotScheduler
:onLinkClick="onLinkClick"
/>const onLinkClick = (args) => {
console.log("Link clicked before default action", args.link);
};See Also
Links [doc.daypilot.org]
DayPilot.Scheduler.onLinkClicked
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot