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.
DayPilot.Scheduler.onTimeRangeRightClick(args)args.start (DayPilot.Date) - selection start
args.end (DayPilot.Date) - selection end
args.resource (string | number) - selection resource id
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.preventDefault() - cancels the default action
Use DayPilot.Scheduler.onTimeRangeRightClicked for the companion event that fires after the default action has been performed.
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);
};Time Range Selecting [doc.daypilot.org]
DayPilot.Scheduler.onTimeRangeRightClicked