The onRectangleSelecting event handler is a real-time event that fires while the rectangle selection is in progress in the JavaScript Scheduler.
Declaration
DayPilot.Scheduler.onRectangleSelecting(args)Parameters
args.events- array of events that overlap the rectangleargs.start(DayPilot.Date) - rectangle selection start timeargs.end(DayPilot.Date) - rectangle selection end timeargs.resources- array of resource IDs that overlap the rectangle selectionargs.visible(boolean) - lets you hide the rectangle highlight
Notes
Use this event to update the UI while the user changes the selected rectangle. Set args.visible = false when you want to hide the built-in rectangle highlight and provide custom feedback instead.
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onRectangleSelecting: (args) => {
if (args.events.length === 0) {
args.visible = false;
}
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onRectangleSelecting: (args) => {
if (args.events.length === 0) {
args.visible = false;
}
},
// ...
};React
<DayPilotScheduler
onRectangleSelecting={onRectangleSelecting}
{/* ... */}
/>const onRectangleSelecting = (args) => {
if (args.events.length === 0) {
args.visible = false;
}
};Vue
<DayPilotScheduler
@rectangleSelecting="onRectangleSelecting"
<!-- ... -->
/>const onRectangleSelecting = (args) => {
if (args.events.length === 0) {
args.visible = false;
}
};See Also
Rectangle Selection [doc.daypilot.org]
DayPilot.Scheduler.onRectangleSelect
DayPilot.Scheduler.onRectangleSelected
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot