DayPilot.Scheduler.onRectangleSelected

The onRectangleSelected event handler fires when the rectangle selection is complete in the JavaScript Scheduler, after the default action.

Declaration

DayPilot.Scheduler.onRectangleSelected(args)

Parameters

  • args.events (array of DayPilot.Event) - events that overlap with the selection rectangle after the default action has completed

Notes

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.

Examples

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);
};

See Also

Rectangle Selection [doc.daypilot.org]

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript