DayPilot.Gantt.onRowCollapse

The onRowCollapse event handler fires when the user collapses a task tree node in the JavaScript Gantt Chart.

Declaration

DayPilot.Gantt.onRowCollapse(args)

Parameters

  • args.control (DayPilot.Gantt) - component reference

  • args.task (DayPilot.Task) - collapsed task

  • args.preventDefault() - prevents the action specified by rowCollapseHandling

Notes

Calling args.preventDefault() doesn't prevent the node from collapsing. It only prevents the action specified using rowCollapseHandling.

Examples

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();
  }
};

See Also

DayPilot.Gantt.onRowExpand

DayPilot.Task Class

DayPilot.Gantt Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript