PDA

View Full Version : Refreshing an Async Tree Node



skhan
19 Jun 2008, 6:48 AM
What would be the best way to refresh a node of an Async Tree.
Take the AsyncTreePage as an example.
The root node is gxt and it has once child - samples.
Now say i add another folder to gxt on the filesystem, how can I force that node to refresh it's children to display this new folder.

Thanks

sdc
23 Jun 2008, 3:33 AM
I think you have to add your folder using the TreeStore.add(M parent, M item, boolean addChildren) method. If Darell or you know a better solution, I'd be happy to know it ;)

darrellmeyer
23 Jun 2008, 7:04 AM
With the lastest code, you can "reload" the model using your loader.


RootPanel.get().add(new Button("Reload", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
ModelData model = store.getChild(0);
// dont want animations when the tree is refreshed
tree.setAnimate(false);
loader.loadChildren(model);
}
}));