I've an Async TreePanel that uses an RPC proxy to load data from server. I want to reload a node by using:
this.treeLoader.loadChildren(nodeModel);
Then, I want the loaded tree node to become expanded. I tried to:
treePanel.setExpanded(nodeModel, true, false);
but the first call is asynchronous so the "setExpanded" happens before the nodes get loaded.
A solution would be to use a LoadListener on the treeLoader and expand the node after it's children are loaded but the listener's loaderLoad(..) method can't know directly the reason for the reload: maybe the user expanded a node and this triggered the reload or maybe the user clicked on a menu option to reload the node.
Is there any way to improve this so it's easier to trigger the node expand after the user wants to reload a node?
Thanks.