The onRowExpand event handler fires when the user expands a task tree node in the JavaScript Gantt Chart.
DayPilot.Gantt.onRowExpand(args)args.control (DayPilot.Gantt) - component reference
args.task (DayPilot.Task) - expanded task
args.preventDefault() - prevents the action specified by rowExpandHandling
Calling args.preventDefault() doesn't prevent the node from expanding. It only prevents the action specified using rowExpandHandling.
JavaScript
const gantt = new DayPilot.Gantt("dp", {
onRowExpand: (args) => {
if (args.task.text() === "Summary") {
args.preventDefault();
}
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
onRowExpand: (args) => {
if (args.task.text() === "Summary") {
args.preventDefault();
}
},
// ...
};React
<DayPilotGantt
onRowExpand={onRowExpand}
{/* ... */}
/>const onRowExpand = (args) => {
if (args.task.text() === "Summary") {
args.preventDefault();
}
};Vue
<DayPilotGantt
@rowExpand="onRowExpand"
<!-- ... -->
/>const onRowExpand = (args) => {
if (args.task.text() === "Summary") {
args.preventDefault();
}
};