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