change

Fired when the user selects a task in the Gantt.

The event handler function context (available via the this keyword) will be set to the widget instance.

Event Data

e.sender kendo.ui.Gantt

The widget instance which fired the event.

Example - subscribe to the "change" event during initialization

<div id="gantt"></div>
<script>
$("#gantt").kendoGantt({
  dataSource: [
    {
      id: 1,
      orderId: 0,
      parentId: null,
      title: "Task1",
      start: new Date("2014/6/17 9:00"),
      end: new Date("2014/6/17 11:00")
    },
    {
      id: 2,
      orderId: 1,
      parentId: null,
      title: "Task2",
      start: new Date("2014/6/17 12:00"),
      end: new Date("2014/6/17 14:00")
    }
  ],
  change: function(e) {
    var selection = this.select();
    var task;

    if (selection) {
      task = this.dataItem(selection);
      console.log(kendo.format("{0} is selected", task.title));
    }
  }
});
</script>

Example - subscribe to the "change" event after initialization

<div id="gantt"></div>
<script>
function gantt_change(e) {
  var selection = this.select();
    var task;

    if (selection) {
      task = this.dataItem(selection);
      console.log(kendo.format("{0} is selected", task.title));
    }
}
$("#gantt").kendoGantt({
  dataSource: [
    {
      id: 1,
      orderId: 0,
      parentId: null,
      title: "Task1",
      start: new Date("2014/6/17 9:00"),
      end: new Date("2014/6/17 11:00")
    },
    {
      id: 2,
      orderId: 1,
      parentId: null,
      title: "Task2",
      start: new Date("2014/6/17 12:00"),
      end: new Date("2014/6/17 14:00")
    }
  ]
});
var gantt = $("#gantt").data("kendoGantt");
gantt.bind("change", gantt_change);
</script>
In this article
Not finding the help you need?