The onRowClick event handler fires when the user clicks a task row header in the Gantt Chart, before the default action specified by rowClickHandling.
The default action can be canceled by calling args.preventDefault().
Declaration
DayPilot.Gantt.onRowClick(args)Parameters
args.task- DayPilot.Task object representing the task.args.x(number) - column index.args.preventDefault()- cancels the default action.
Examples
JavaScript
const gantt = new DayPilot.Gantt("dp", {
rowClickHandling: "Enabled",
onRowClick: (args) => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
rowClickHandling: "Enabled",
onRowClick: args => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
},
// ...
};React
<DayPilotGantt
rowClickHandling="Enabled"
onRowClick={onRowClick}
{/* ... */}
/>const onRowClick = (args) => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
};Vue
<DayPilotGantt
rowClickHandling="Enabled"
@rowClick="onRowClick"
<!-- ... -->
/>const onRowClick = (args) => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot