Edit this page

autoBind Boolean (default: true)

If set to false the widget will not bind to the specified DataSource during initialization. In this case data binding will occur when the change event of the DataSource is fired. By default the widget will bind to the DataSource specified in the configuration.

Setting autoBind to false is useful when multiple widgets are bound to the same DataSource. Disabling automatic binding ensures that the shared DataSource doesn't make more than one request to the remote service.

Example - disable automatic binding

<div id="treelist"></div>
<button id="btn">Bind TreeList</button>
<script>
  var dataSource = new kendo.data.TreeListDataSource({
    transport: {
      read: {
        url: "https://demos.telerik.com/kendo-ui/service/EmployeeDirectory/All",
        dataType: "jsonp"
      }
    },
    schema: {
      model: {
        id: "EmployeeID",
        parentId: "ReportsTo",
        fields: {
          ReportsTo: { field: "ReportsTo",  nullable: true },
          EmployeeID: { field: "EmployeeId", type: "number" },
          Extension: { field: "Extension", type: "number" }
        },
        expanded: true
      }
    }
  });
  var treelist = $("#treelist").kendoTreeList({
    dataSource: dataSource,
    columns: [
      { field: "FirstName" }, { field: "LastName" }, { field: "Position" }
    ],
    autoBind: false
  }).data("kendoTreeList");

  $("#btn").click(function(){
    treelist.dataSource.read();
  });
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy