The onTimeRangeRightClick event handler fires when the user right-clicks an existing time range selection, or creates a selection using the right mouse button, in the JavaScript Scheduler component, before the default action configured by timeRangeRightClickHandling is performed.
Declaration
DayPilot.Scheduler.onTimeRangeRightClick(args)Parameters
args.start(DayPilot.Date) - selection startargs.end(DayPilot.Date) - selection endargs.resource(string | number) - selection resource idargs.alt(boolean) -trueif the Ctrl key was pressed (since 2026.2.6911)args.ctrl(boolean) -trueif the Ctrl key was pressedargs.meta(boolean) -trueif the Meta key was pressedargs.shift(boolean) -trueif the Shift key was pressedargs.preventDefault()- cancels the default action
Notes
Use DayPilot.Scheduler.onTimeRangeRightClicked for the companion event that fires after the default action has been performed.
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onTimeRangeRightClick: (args) => {
args.preventDefault();
console.log(args.start.toString(), args.end.toString(), args.resource);
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onTimeRangeRightClick: (args) => {
args.preventDefault();
console.log(args.start.toString(), args.end.toString(), args.resource);
},
// ...
};React
<DayPilotScheduler
onTimeRangeRightClick={onTimeRangeRightClick}
{/* ... */}
/>const onTimeRangeRightClick = (args) => {
args.preventDefault();
console.log(args.start.toString(), args.end.toString(), args.resource);
};Vue
<DayPilotScheduler
@timeRangeRightClick="onTimeRangeRightClick"
<!-- ... -->
/>const onTimeRangeRightClick = (args) => {
args.preventDefault();
console.log(args.start.toString(), args.end.toString(), args.resource);
};See Also
Time Range Selecting [doc.daypilot.org]
DayPilot.Scheduler.onTimeRangeRightClicked
DayPilot.Scheduler.timeRangeRightClickHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot