There is no direct "click" event, but there is selection, which is mostly the same. Selection event appears when users selects some task by clicking on bar or table's columns
Assuming that we are talking about react
const init = api => {
api.on("select-task", ev => {
console.log("The id of the selected task:", ev.id);
});
};
return (<Gantt init={init} tasks={tasks} links={links} />);
https://docs.svar.dev/react/gantt/api/actions/select-task
By default Gantt will try to show the editor panel, which can be blocked by using "readonly" mode and replaced with custom interaction
https://docs.svar.dev/react/gantt/api/properties/readonly
or you can use the same select-task
event in the intercept mode
const init = api => {
api.intercept("select-task", ev => {
console.log("The id of the selected task:", ev.id);
// block selection, so there will be no reaction for the event in the component
// can be used to show a custom info panel for clicking on a task
return false;
});
};
return (<Gantt init={init} tasks={tasks} links={links} />);