DayPilot.Gantt.onRowCreate

The onRowCreate event handler fires when new row text is submitted in the JavaScript Gantt Chart, before the default action specified by rowCreateHandling.

Declaration

DayPilot.Gantt.onRowCreate(args)

Parameters

  • args.text (string) - new text submitted by the user

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

Notes

Use args.preventDefault() when you need to validate or replace the default action configured by rowCreateHandling. The corresponding onRowCreated event fires after that default action completes.

Examples

JavaScript

const gantt = new DayPilot.Gantt("dp", {
  onRowCreate: (args) => {
    if (!args.text.trim()) {
      args.preventDefault();
    }
  },
  // ...
});
gantt.init();

Angular

<daypilot-gantt [config]="config"></daypilot-gantt>
config: DayPilot.GanttConfig = {
  onRowCreate: (args) => {
    if (!args.text.trim()) {
      args.preventDefault();
    }
  },
  // ...
};

React

<DayPilotGantt
  onRowCreate={onRowCreate}
  {/* ... */}
/>
const onRowCreate = (args) => {
  if (!args.text.trim()) {
    args.preventDefault();
  }
};

Vue

<DayPilotGantt
  @rowCreate="onRowCreate"
  <!-- ... -->
/>
const onRowCreate = (args) => {
  if (!args.text.trim()) {
    args.preventDefault();
  }
};

See Also

DayPilot.Gantt.onRowCreated

DayPilot.Gantt.rowCreateHandling

DayPilot.Gantt Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript