DayPilot.Scheduler.onEventSelected

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 item

  • args.change ("selected" | "deselected") - selection change

  • args.selected (boolean) - current selection state after the change

  • args.ctrl (boolean) - Ctrl key state

  • args.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

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript