-
14 Jun 2010 12:00 AM #1
[CLOSED] TreePanel Events.BeforeSelect - cancel
[CLOSED] TreePanel Events.BeforeSelect - cancel
In TreePanel, if you try to select a row, cancel the BeforeSelect event, then the previous selected is no more selected (visual). See following example:
Win7, FF, GXT trunkCode:@Override public void onModuleLoad() { TreeStore store = new TreeStore(); TreeModel model = new BaseTreeModel(); model.set("name", "model a"); store.add(model, false); model = new BaseTreeModel(); model.set("name", "model b"); store.add(model, false); TreePanel panel = new TreePanel<ModelData>(store); panel.setDisplayProperty("name"); panel.getSelectionModel().select(model, false); panel.getSelectionModel().addListener(Events.BeforeSelect, new Listener<SelectionEvent<TreeModel>>() { @Override public void handleEvent(SelectionEvent<TreeModel> be) { be.setCancelled(true); } }); RootPanel.get().add(panel); }
-
14 Jun 2010 1:26 AM #2
This is not a bug. This is how it works at the moment. selecting an deselecting are two steps. If you dont want to keep selected items, than they are first cleared before selecting new ones. The beforeselect event gets fired for each model you are going to select.
We cannot change this in any GXT 2.X release as it would be a braking change.
We could add a BeforeDeselect and Deselect event, but the time left to the 2.2 release is probably too short.
-
14 Jun 2010 3:17 AM #3
Thanks for reply. Okay, BeforeDeselect and Deselect event would be a suffice anternative. (At least for my usecase.) Would be great if you could extend that to those events.
-
22 Jul 2010 12:41 AM #4
-
22 Jul 2010 12:45 AM #5
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[CLOSED] Popup sends Events.Open not Events.Show contradicting API docs
By janekdb in forum Ext GWT: Bugs (2.x)Replies: 2Last Post: 29 Mar 2010, 7:27 AM -
[CLOSED][3.0rc1.1] RowEditor not handling cancel
By arnaldur in forum Ext 3.x: BugsReplies: 9Last Post: 13 Nov 2009, 9:55 PM -
[DataListEvent ] Events.BeforeSelect
By nannous in forum Ext GWT: Help & Discussion (1.x)Replies: 0Last Post: 25 Feb 2009, 6:43 AM -
[OPEN] Ext.tree.TreePanel: unable to cancel events
By schmidetzki in forum Ext 1.x: BugsReplies: 5Last Post: 26 Jun 2007, 6:18 AM


Reply With Quote