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 objectargs.selected(boolean) -trueif the row has just been selected;falseif it has just been unselectedargs.ctrl(boolean) -trueif the Ctrl key is pressedargs.shift(boolean) -trueif the Shift key is pressedargs.meta(boolean) -trueif the Meta key is pressedargs.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:
row(DayPilot.Row) - affected row object
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
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot