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.
DayPilot.Calendar.onEventRightClick(args)args.e (DayPilot.Event) - object representing the clicked event
args.preventDefault() - cancels the default action
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.
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();
}
};DayPilot.Calendar.eventRightClickHandling