The onEventSelected event handler fires when event selection changes in the JavaScript Scheduler, after the default UI action selects or deselects the event.
Declaration
DayPilot.Scheduler.onEventSelected(args)Parameters
args.e(DayPilot.Event) - affected itemargs.change("selected"|"deselected") - selection changeargs.selected(boolean) - current selection state after the changeargs.ctrl(boolean) - Ctrl key stateargs.meta(boolean) - Meta key state
Notes
This event runs after the Scheduler updates the UI selection state. Use DayPilot.Scheduler.onEventSelect when you need to inspect or cancel the change before it happens.
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onEventSelected: (args) => {
document.getElementById("selection").textContent = args.selected ? "Event selected" : "Event deselected";
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onEventSelected: (args) => {
console.log(args.change);
},
// ...
};React
<DayPilotScheduler
onEventSelected={onEventSelected}
{/* ... */}
/>const onEventSelected = (args) => {
console.log(args.change);
};Vue
<DayPilotScheduler
@eventSelected="onEventSelected"
<!-- ... -->
/>const onEventSelected = (args) => {
console.log(args.change);
};See Also
Event Selecting [doc.daypilot.org]
DayPilot.Scheduler.onEventSelect
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot