The onRowClick event handler fires when the user clicks a row header in the JavaScript Scheduler component, before the default action specified by rowClickHandling.
You can cancel that default action by calling args.preventDefault().
Declaration
DayPilot.Scheduler.onRowClick(args)Parameters
args.row(DayPilot.Row) - clicked rowargs.x(number) - row header column index when row header columns are defined; available since 2023.1.5513args.ctrl(boolean) - Ctrl key stateargs.shift(boolean) - Shift key stateargs.meta(boolean) - Meta key stateargs.originalEvent(MouseEvent) - original click event object (available since 2023.4.5756)args.preventDefault()- cancels the default action specified by rowClickHandling
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
rowClickHandling: "Enabled",
onRowClick: (args) => {
console.log("Clicked row", args.row);
},
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
rowClickHandling: "Enabled",
onRowClick: (args) => {
console.log("Clicked row", args.row);
},
// ...
};React
<DayPilotScheduler
rowClickHandling="Enabled"
onRowClick={onRowClick}
{/* ... */}
/>const onRowClick = (args) => {
console.log("Clicked row", args.row);
};Vue
<DayPilotScheduler
rowClickHandling="Enabled"
@rowClick="onRowClick"
<!-- ... -->
/>const onRowClick = (args) => {
console.log("Clicked row", args.row);
};See Also
DayPilot.Scheduler.rowClickHandling
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
Lite args missing: x
DayPilot