DayPilot.Calendar.onEventRightClick

The onEventRightClick event handler fires when the user clicks a calendar event using the right mouse button in the JavaScript Calendar component, before the default action configured by eventRightClickHandling is performed.

Declaration

DayPilot.Calendar.onEventRightClick(args)

Parameters

  • args.e (DayPilot.Event) - object representing the clicked event

  • args.preventDefault() - cancels the default action

Notes

Use args.preventDefault() when you need to suppress the action specified by eventRightClickHandling. The paired DayPilot.Calendar.onEventRightClicked event handler fires after the default action.

In api=1 mode, the legacy signature is onEventRightClick(e), where e is the DayPilot.Event reference.

Examples

JavaScript

const calendar = new DayPilot.Calendar("dp", {
  onEventRightClick: (args) => {
    if (args.e.data.type === "readonly") {
      args.preventDefault();
    }
  },
  // ...
});
calendar.init();

Angular

<daypilot-calendar [config]="config"></daypilot-calendar>
config: DayPilot.CalendarConfig = {
  onEventRightClick: (args) => {
    if (args.e.data.type === "readonly") {
      args.preventDefault();
    }
  },
  // ...
};

React

<DayPilotCalendar
  onEventRightClick={onEventRightClick}
  {/* ... */}
/>
const onEventRightClick = (args) => {
  if (args.e.data.type === "readonly") {
    args.preventDefault();
  }
};

Vue

<DayPilotCalendar
  @eventRightClick="onEventRightClick"
  <!-- ... -->
/>
const onEventRightClick = (args) => {
  if (args.e.data.type === "readonly") {
    args.preventDefault();
  }
};

See Also

DayPilot.Calendar.eventRightClickHandling

DayPilot.Calendar.onEventRightClicked

DayPilot.Calendar Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript