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().
DayPilot.Scheduler.onRowSelect(args)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
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
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);
};