The tasks.add() method adds a new task to the JavaScript Gantt Chart and updates the view.
Declaration
DayPilot.Gantt.tasks.add(task)Parameters
task(DayPilot.Task or source data object) - task to be added
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
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot