DayPilot.Calendar.onEventSelect

The onEventSelect event handler fires before the calendar applies an event selection change.

Declaration

DayPilot.Calendar.onEventSelect(args)

Parameters

  • args.e - event being selected or deselected.

  • args.selected (boolean) - target selection state.

  • args.ctrl (boolean) - indicates whether the Ctrl/Command multi-select modifier was used.

  • args.meta - additional selection metadata (description pending).

  • args.preventDefault() - cancels the default selection change.

Notes

Call args.preventDefault() if your application needs to reject the selection request.

The legacy api=1 used the declaration onEventSelect(e, change).

Example

const dp = new DayPilot.Calendar("dp", {
  onEventSelect: (args) => {
    if (args.selected && args.e.data.locked) {
      args.preventDefault();
    }
  },
  // ...
});
dp.init();

See Also

DayPilot.Calendar.onEventSelected

Event Selecting [doc.daypilot.org]

DayPilot.Calendar Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript