jQuery EasyUI Tree Menu - Lazily Loading Nodes in a TreeGrid
Sometimes we already have full hierarchical TreeGrid data. We still want the TreeGrid to lazily load nodes by level. First, only the top-level nodes are loaded. Then clicking a node's expand icon loads its child nodes. This tutorial shows how to create a TreeGrid with lazy loading.
Creating a TreeGrid
Name
Size
Modified Date
To avoid loading child nodes, we need to rename the 'children' property for each node. As shown in the code below, the 'children' property is renamed to 'children1'. When a node is expanded, we call the 'append' method to load its child node data.
'loadFilter' code
function myLoadFilter(data,parentId){
function setData(){
var todo = [];
for(var i=0; i