dataBinding

Fired before the widget binds to its data source.

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

Event Data

e.sender kendo.ui.TreeList

The widget instance which fired the event.

e.preventDefault Function

If invoked prevents the data bind action. The table rows will remain unchanged and dataBound event will not fire.

Example - subscribe to the "dataBinding" event before initialization

<div id="treeList"></div>
 <script>
    $("#treeList").kendoTreeList({
      columns: [
        { field: "Name" },
        { field: "Position" }
      ],
      dataSource: [
        { id: 1, Name: "Daryl Sweeney", Position: "CEO", parentId: null },
        { id: 2, Name: "Guy Wooten", Position: "Chief Technical Officer", parentId: 1 }
      ],
      dataBinding: function(e) {
        console.log("dataBinding");
      }
    });
</script>

Example - subscribe to the "dataBinding" event after initialization

<div id="treeList"></div>
 <script>
    function dataBinding(e) {
        console.log("dataBinding");
    }
    $("#treeList").kendoTreeList({
      columns: [
        { field: "Name" },
        { field: "Position" }
      ],
      dataSource: [
        { id: 1, Name: "Daryl Sweeney", Position: "CEO", parentId: null },
        { id: 2, Name: "Guy Wooten", Position: "Chief Technical Officer", parentId: 1 }
      ]
    });

    var treeList = $("#treeList").data("kendoTreeList");
    treeList.bind("dataBinding", dataBinding);
    treeList.dataSource.fetch();
</script>
In this article
Not finding the help you need?