The onEventSelect handler fires before the monthly calendar applies an event selection change.
Declaration
DayPilot.Month.onEventSelect(args)Parameters
args.e(DayPilot.Event) - affected itemargs.selected(boolean) - current selection state before the changeargs.ctrl(boolean) - Ctrl key stateargs.preventDefault()- cancels the default selection change
Notes
Call args.preventDefault() when the selection change should be rejected.
In api=1 mode, the legacy signature is onEventSelect(e, change).
Examples
JavaScript
const month = new DayPilot.Month("dp", {
onEventSelect: (args) => {
if (args.e.data.locked) {
args.preventDefault();
}
},
// ...
});
month.init();Angular
<daypilot-month [config]="config"></daypilot-month>config: DayPilot.MonthConfig = {
onEventSelect: (args) => {
if (args.e.data.locked) {
args.preventDefault();
}
},
// ...
};React
<DayPilotMonth
onEventSelect={onEventSelect}
{/* ... */}
/>const onEventSelect = (args) => {
if (args.e.data.locked) {
args.preventDefault();
}
};Vue
<DayPilotMonth
@eventSelect="onEventSelect"
<!-- ... -->
/>const onEventSelect = (args) => {
if (args.e.data.locked) {
args.preventDefault();
}
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot