setDataSource

Sets the tasks data source of the widget.

Parameters

dataSource kendo.data.GanttDataSource

The tasks data source to which the widget should be bound.

Example - set the tasks data source

<div id="gantt"></div>
<script>
$("#gantt").kendoGantt();
var gantt = $("#gantt").data("kendoGantt");
var dataSource = new kendo.data.GanttDataSource({
  data: [
    {
      id: 1,
      orderId: 0,
      parentId: null,
      title: "Task1",
      start: new Date("2014/6/17 9:00"),
      end: new Date("2014/6/17 11:00")
    }
  ]
});
gantt.setDataSource(dataSource);
</script>
In this article