Demos
Documentation
API
More Samples
Download Wijmo

Re-loading Lazy-Loaded Nodes

The TreeView's lazyLoadFunction property allows you to create nodes that are loaded only when the node is expanded.

This can be used to improve performance in cases where data is loaded asynchronously.

By default, lazy nodes load their data only once, when the node is expanded for the first time. This sample shows how you can change that behavior for selected nodes causing them to re-load their data whenever they are expanded. The sample does this by:

  1. Clearing the node's lazy-loaded data when the node is collapsed, and
  2. Re-binding the tree to remove the old nodes.