DayPilot.Gantt.tasks.add

Adds a new link to the Gantt chart and updates the view.

Declaration

DayPilot.Gantt.tasks.add(task);

Parameters

Description

This methods updates the view immediately. When adding more tasks to a Gantt chart that is already visible (initialized), it's faster to use bulk loading using tasks.list.

Example

<div id="gantt"></div>

<script>
  var gantt = new DayPilot.Gantt("gantt");

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

  gantt.init();

</script>

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java