New to Kendo UI for jQueryStart a free 30-day trial

Loading

methods

Gets or sets the loading state of the Node. This flag indicates whether the node is currently in the process of loading its child items. Setting the loading flag is typically done internally during the load operation, but it can be accessed to check the current loading state.

Returns:Boolean

—The current loading state of the node when called without parameters. Returns true if the node is currently loading its children, false otherwise.

<script>
var dataSource = new kendo.data.HierarchicalDataSource({
    transport: {
        read: {
            url: "https://demos.telerik.com/service/v2/core/Employees"
        }
    },
  schema: {
    model: {
      id: "EmployeeId",
      hasChildren: "HasEmployees"
    }
  }
});

dataSource.fetch(function() {
  var node = dataSource.at(0);
  /* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(node.loading()); // outputs "false" - not loading initially
  
  // The load method checks loading state internally to prevent duplicate loads
  node.load(); // initiates loading, sets loading(true) internally
  
  // During load operation
  /* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(node.loading()); // outputs "true" while loading
  
  // After load completes, loading is automatically set to false
});
</script>
Not finding the help you need?
Contact Support