Reputation: 3034
I have requirement where some times I would like to load children as well as grand children and if possible their children in lazy loading..Is it possible?
When I am preparing json response for lazy loading can I prepare json response like this?
[ { "title": "Node1", "isLazy": true, "key": "BC13B21636CD6D5C", }, { … }, … ]
to solve my problem can I try like this ?
[ { "title": "Node1", "isLazy": true, "key": "BC13B21636CD6D5C",children:{ "title": "childNode", "isLazy": true, "key": "asdaasas"} }, { … }, … ]
will this work ?
Actually requirement is when the page loads depending one some condition a particular node down the tree should be expanded and activated, shown to the user.Also lazy loading of other nodes can take place if user wants as normal.
Upvotes: 2
Views: 1055
Reputation: 14814
Yes, that should work: You can pass nested structures.
Note that if a node has children
defined, the "isLazy": true
flag is not required (but does not hurt either).
Upvotes: 2