resources.dataSource Object|Array|

The data source which contains resource data items. Can be a JavaScript object which represents a valid data source configuration, a JavaScript array or an existing instance.

If the dataSource option is set to a JavaScript object or array the widget will initialize a new instance using that value as data source configuration.

If the dataSource option is an existing instance the widget will use that instance and will not initialize a new one.

Example - set the resource data source

<div id="gantt"></div>
  dataSource: [{
    id: 0,
    orderId: 0,
    parentId: null,
    title: "Task1",
    start: new Date("2014/6/17 9:00"),
    end: new Date("2014/7/01 11:00")
  resources: {
    dataSource: [
      { id: 0, name: "Resource 1", color: "green" },
      { id: 1, name: "Resource 2", color: "#32cd32" }
  assignments: {
    dataSource: [
      { taskId: 0, resourceId: 1, value: 1 }
  views: ["week"]
In this article