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().
DayPilot.Gantt.onRowClick(args)args.task - DayPilot.Task object representing the task.
args.x (number) - column index.
args.preventDefault() - cancels the default action.
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());
};