-
16 Aug 2012 6:23 AM #1
TreeGridSelectionModel.select(model) is not selecting model in TreeGrid
TreeGridSelectionModel.select(model) is not selecting model in TreeGrid
Required Information
Version(s) of Ext GWT
«Ext GWT 3.0.0b»
Browser versions and OS
(and desktop environment, if applicable)- «Chrome 17, Windows 7»
Virtual Machine
«Yes»
Description
Using the TreeGridSelectionModel.select(item, true) does not seem to work for a TreeGrid. I have traced the code execution to find out that in class AbstractStoreSelection.doSingleSelect(M model) the following code gets executed:
In the case of a TreeGrid the first if block always applies because of the code found in the TreeGrid's constructor. createListStore()Code:if (store instanceof ListStore) { ListStore<M> ls = (ListStore<M>) store; index = ls.indexOf(model); } if (store instanceof TreeStore) { TreeStore<M> ls = (TreeStore<M>) store; index = ls.indexOf(model); }
However, executing index = ls.indexOf(model) will always return -1 even if the model exists in the treeStore. This seems to be related to method indexOf(model) that only looks for model in visibleItems. visibleItems seems to always be empty in the case of TreeGrids.Code:this.cm = cm; setTreeColumn(treeColumn); this.treeStore = store; this.store = createListStore(); setSelectionModel(new TreeGridSelectionModel<M>());
As i am new to GXT, it is possible that I am missing something obvious on the way to select items in TreeGrids.Code:public int indexOf(M item) { return visibleItems.indexOf(item); }
Thanks.
Run mode
Development Mode
Possible fix
Maybe having visibleItems of ListStore populated upon TreeGrid creation.
Thanks
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote