PDA

View Full Version : Unexpected TreePanel collapses on tree store updates rc1/rc2



entraspan
1 Jul 2009, 9:50 PM
I want to dynamically change an icon at runtime and was forcing a refresh with:


TreeStoreEvent<VehicleModel> event = new TreeStoreEvent<VehicleModel(tree.getStore());
event.setModel(vm);
tree.getStore().fireEvent(Store.DataChanged, event);As soon as an event is sent it would collapse all of the top level folders.

I finally just subclassed TreePanel and exposed the refresh method so I could call it directly and everything worked perfectly.

Seems like a bug but maybe this is the intended behavior?

Is there a better way to dynamically refresh icons in a TreePanel?

fyi, this was a TreePanel with the following options:


tree.setCheckable(true);
tree.setCheckStyle(TreePanel.CheckCascade.NONE);
tree.setDisplayProperty("name");
tree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);Plus a custom IconProvider and standard event handlers, etc.