Be sure your post includes:
Hi,
I'm using SmartGWT LGPL 2.4 and don't know how to achieve the following:
I have a databound TreeGrid where I programatically want to expand down to and select some leaf node in the tree that may not have been retrieved from the server yet due to on-demand loading (large tree).
I do have all the IDs/parentIDs for the tree nodes from leaf up to root so in theory I have all info to fetch all the TreeNode involved.
I have tried something like the below pseudocode but does not seem to work. I suppose one should also wait for the expand code to asynchronously returning the child dataset before trying to expand the next level.
Any ideas?
Hi,
I'm using SmartGWT LGPL 2.4 and don't know how to achieve the following:
I have a databound TreeGrid where I programatically want to expand down to and select some leaf node in the tree that may not have been retrieved from the server yet due to on-demand loading (large tree).
I do have all the IDs/parentIDs for the tree nodes from leaf up to root so in theory I have all info to fetch all the TreeNode involved.
I have tried something like the below pseudocode but does not seem to work. I suppose one should also wait for the expand code to asynchronously returning the child dataset before trying to expand the next level.
Code:
for (id = rootid; !isLeaf(id); id = childOf(id)) { ListGridRecord gridRecord = treeGrid.getTree().findById(id); if (gridRecord != null) { treeGrid.expandRecord(gridRecord); } }
Comment