The onEventClick event handler fires in the JavaScript Scheduler before the default event click action defined by DayPilot.Scheduler.eventClickHandling.
Declaration
DayPilot.Scheduler.onEventClick(args)Parameters
args.e(DayPilot.Event) - clicked event instanceargs.div(HTMLElement) - event <div> elementargs.control(DayPilot.Scheduler) - control instanceargs.ctrl(boolean) -trueif the Ctrl key was pressedargs.meta(boolean) -trueif the Meta key was pressedargs.shift(boolean) -trueif the Shift key was pressedargs.originalEvent(MouseEvent) - original browser click eventargs.preventDefault()- cancels the default action configured using DayPilot.Scheduler.eventClickHandling
Notes
In api=1 mode, the legacy signature is onEventClick(e).
Examples
JavaScript
const onEventClick = (args) => {
if (args.e.id() === 3) {
args.preventDefault();
}
};
const dp = new DayPilot.Scheduler("dp", {
onEventClick: onEventClick,
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>const onEventClick = (args: DayPilot.SchedulerEventClickArgs) => {
if (args.e.id() === 3) {
args.preventDefault();
}
};
config: DayPilot.SchedulerConfig = {
onEventClick: onEventClick,
// ...
};React
<DayPilotScheduler
onEventClick={onEventClick}
{/* ... */}
/>const onEventClick = (args) => {
if (args.e.id() === 3) {
args.preventDefault();
}
};Vue
<DayPilotScheduler
@eventClick="onEventClick"
<!-- ... -->
/>const onEventClick = (args) => {
if (args.e.id() === 3) {
args.preventDefault();
}
};See Also
DayPilot.Scheduler.onEventClicked
DayPilot.Scheduler.eventClickHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot