DayPilot.Scheduler.onEventClick

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 instance

  • args.div (HTMLElement) - event <div> element

  • args.control (DayPilot.Scheduler) - control instance

  • args.ctrl (boolean) - true if the Ctrl key was pressed

  • args.meta (boolean) - true if the Meta key was pressed

  • args.shift (boolean) - true if the Shift key was pressed

  • args.originalEvent (MouseEvent) - original browser click event

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

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript