The onTaskClicked event handler fires when the user clicks a task box in the Gantt Chart, after the default action specified by taskClickHandling.
DayPilot.Gantt.onTaskClicked(args)args.task - DayPilot.Task object representing the task.
JavaScript
const gantt = new DayPilot.Gantt("dp", {
taskClickHandling: "Enabled",
onTaskClicked: (args) => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
taskClickHandling: "Enabled",
onTaskClicked: args => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
},
// ...
};React
<DayPilotGantt
taskClickHandling="Enabled"
onTaskClicked={onTaskClicked}
{/* ... */}
/>const onTaskClicked = (args) => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
};Vue
<DayPilotGantt
taskClickHandling="Enabled"
@taskClicked="onTaskClicked"
<!-- ... -->
/>const onTaskClicked = (args) => {
DayPilot.Modal.alert("Clicked: " + args.task.id());
};