PDA

View Full Version : [FIXED] [GXT2.0-M3] TreePanel Problem



jgyhuzhou
15 Jun 2009, 11:06 PM
when i change TreeStore node's displayProperty value, why TreePanel not refresh for new show name?
also when i delete one node from TreeStore, TreePanel not refresh.

but when i add a node in TreeStore, TreePanel refreshed.

Rvanlaak
16 Jun 2009, 12:02 AM
You might can force a refresh with the 'layout()' command?

sven
16 Jun 2009, 1:46 AM
Please read the bug forum gudielines. YOur post is missing some really important details.

jgyhuzhou
16 Jun 2009, 2:06 AM
ok, i run in host model. and the code is like this.


final Group g = tree.getSelectionModel().getSelectedItem();
service.deleteGroup(g.getId(), new AsyncCallback<Void>() {

@Override
public void onSuccess(Void arg0) {
store.remove(g);

}

});


but the UI not refresh and remove this node.

but if i add a node like this


final Group g = new Group();
g.setGroupName(name.getValue());
g.setGroupType(type.getSimpleValue());
g.setAddress(address.getValue());
g.setParentId(group.getId());
service.addGroup(g, new AsyncCallback<Group>() {

@Override
public void onSuccess(Group arg0) {
tree.getStore().add(group, arg0, true);
}

});

the TreePanel will refresh the UI and add this node automaticly.

sven
16 Jun 2009, 2:16 AM
Please read the bug forum guidelines again. your code is again not according the guidelines, but more helpfull than the first post;)

sven
16 Jun 2009, 2:18 AM
Also take a look at the examples:

http://www.extjs.com/examples-dev/explorer.html#contextmenutree

removing a node works quite good for me.

jgyhuzhou
16 Jun 2009, 4:12 AM
:D, thank you, sven.
i got it.

btw: my operating system is windows xp, need read again now?

sven
16 Jun 2009, 7:41 AM
Fixed in SVN.