The onRectangleSelected event handler fires when the rectangle selection is complete in the JavaScript Scheduler, after the default action.
DayPilot.Scheduler.onRectangleSelected(args)args.events (array of DayPilot.Event) - events that overlap with the selection rectangle after the default action has completed
The rectangle selection itself also defines a start time, end time, and the overlapping resource ID array. Those values use DayPilot.Date objects for the time range and are available as part of the rectangle selection context.
JavaScript
const dp = new DayPilot.Scheduler("dp", {
rectangleSelectHandling: "EventSelect",
onRectangleSelected: (args) => {
dp.message("Selected events: " + args.events.length);
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
rectangleSelectHandling: "EventSelect",
onRectangleSelected: (args) => {
console.log("Selected events:", args.events.length);
},
// ...
};React
<DayPilotScheduler
rectangleSelectHandling="EventSelect"
onRectangleSelected={onRectangleSelected}
{/* ... */}
/>const onRectangleSelected = (args) => {
console.log("Selected events:", args.events.length);
};Vue
<DayPilotScheduler
rectangleSelectHandling="EventSelect"
@rectangleSelected="onRectangleSelected"
<!-- ... -->
/>const onRectangleSelected = (args) => {
console.log("Selected events:", args.events.length);
};Rectangle Selection [doc.daypilot.org]