Your search did not match any results.
Tree View

Virtual Mode

In virtual mode, the TreeView loads a node's children when the node is expanded for the first time. This enhances performance on large datasets.

To enable this feature, set the virtualModeEnabled property to true. Note that this mode is only available when the TreeView's dataStructure is plain.

When the data source is remote, the TreeView requests data for each expanded node. To prevent this for nodes that do not nest others, set the hasItems field to false for the corresponding data objects.

This demo enables virtual mode with a remote data source and uses the hasItemsExpr property to specify a custom name for the hasItems field.

As an alternative to virtual mode, you can use a custom logic to process requested data. To do this, specify the createChildren function as shown in the Load Data on Demand demo.

Backend API
Copy to CodePen
window.onload = function() { var viewModel = { treeViewOptions: { dataSource: new{ store: new{ url: "" }) }), dataStructure: "plain", keyExpr: "Id", displayExpr: "Name", parentIdExpr: "CategoryId", hasItemsExpr: "IsGroup", virtualModeEnabled: true } }; ko.applyBindings(viewModel, document.getElementById("treeview")); };
<!DOCTYPE html> <html xmlns=""> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src=""></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <script src=""></script> <link rel="stylesheet" type="text/css" href="" /> <link rel="stylesheet" type="text/css" href="" /> <script src=""></script> <script src="data.js"></script> <script src="index.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="treeview"> <div data-bind="dxTreeView: treeViewOptions"></div> </div> </div> </body> </html>