DayPilot.Gantt.onRowExpand

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

Declaration

DayPilot.Gantt.onRowExpand(args)

Parameters

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

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

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

Notes

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

Examples

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

See Also

DayPilot.Gantt.onRowCollapse

DayPilot.Task Class

DayPilot.Gantt Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript