DayPilot.Scheduler.onRowSelect

The onRowSelect event handler fires when row selection changes in the JavaScript Scheduler, before the default action selects or unselects the row in the UI.

You can cancel the default action using args.preventDefault().

Declaration

DayPilot.Scheduler.onRowSelect(args)

Parameters

  • args.row (DayPilot.Row) - affected row object

  • args.selected (boolean) - true if the row has just been selected; false if it has just been unselected

  • args.ctrl (boolean) - true if the Ctrl key is pressed

  • args.shift (boolean) - true if the Shift key is pressed

  • args.meta (boolean) - true if the Meta key is pressed

  • args.preventDefault() - cancels the default row selection change

Notes

In api=1 mode, this event fires after selecting or unselecting the row in the UI. The legacy signature is DayPilot.Scheduler.onRowSelect(row).

Available variable in the legacy handler:

Examples

JavaScript

const dp = new DayPilot.Scheduler("dp", {
  onRowSelect: (args) => {
    if (!args.selected) {
      args.preventDefault();
      return;
    }
    console.log("Row selected", args.row);
  },
  // ...
});
dp.init();

Angular

<daypilot-scheduler [config]="config"></daypilot-scheduler>
config: DayPilot.SchedulerConfig = {
  onRowSelect: (args) => {
    if (!args.selected) {
      args.preventDefault();
      return;
    }
    console.log("Row selected", args.row);
  },
  // ...
};

React

<DayPilotScheduler
  onRowSelect={onRowSelect}
  {/* ... */}
/>
const onRowSelect = (args) => {
  if (!args.selected) {
    args.preventDefault();
    return;
  }
  console.log("Row selected", args.row);
};

Vue

<DayPilotScheduler
  @rowSelect="onRowSelect"
  <!-- ... -->
/>
const onRowSelect = (args) => {
  if (!args.selected) {
    args.preventDefault();
    return;
  }
  console.log("Row selected", args.row);
};

See Also

DayPilot.Scheduler.onRowSelected

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript