The tasks.add() method adds a new task to the JavaScript Gantt Chart and updates the view.
DayPilot.Gantt.tasks.add(task)task (DayPilot.Task or source data object) - task to be added
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.
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"
});