change

Fires when data is changed. In addition to the standard change event, the HierarchicalDataSource includes additional data when the event has been triggered from a child DataSource.

Event Data

e.node kendo.data.Node

If the event was triggered by a child datasource, this field holds a reference to the parent node.

e.action String (optional)

In addition to the standard change event actions, the value can also be:

  • "itemloaded"

Example

<script>
var datasource = new kendo.data.HierarchicalDataSource({
  data: [
    { id: 1, text: "foo", items: [
      { id: 2, text: "bar" }
    ] }
  ],
  change: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(e.node);
  }
});

// logs `undefined`, because the change event is not triggered by a node
datasource.read();

// logs `{ id: 1, text: "foo" }`, because the event is triggered by the root item
datasource.get(1).load();
</script>
In this article