DayPilot.Gantt.tasks.add

The tasks.add() method adds a new task to the JavaScript Gantt Chart and updates the view.

Declaration

DayPilot.Gantt.tasks.add(task)

Parameters

Notes

This method updates the view immediately. When adding more tasks to a Gantt chart that has already been initialized, it is faster to use bulk task loading.

Example

const gantt = new DayPilot.Gantt("gantt", {
  // ...
});
gantt.init();

gantt.tasks.add({
  id: "task-1",
  start: "2028-01-01",
  end: "2028-01-02",
  text: "Task 1"
});

See Also

DayPilot.Task Class

DayPilot.Gantt Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript