PDA

View Full Version : [NO CODE] Grid getSelectionModel.getSelectedItem() not updated properly



Kutu
16 Sep 2008, 4:36 PM
Do the following steps:

0) Prepare ListStore and Grid
1) call grid.getSelectionModel().getSelectedItem()
2) modify the model from the ListStore
3) repeat step 1
4) model is not updated from getSelectedItem()

darrellmeyer
16 Sep 2008, 6:01 PM
Please review these guidelines (http://extjs.com/forum/showthread.php?t=40289) and post again. You should always include the version of Ext GWT you are using. And whenever possible, include some simple test code that illustrates the problem you are seeing.

fes
17 Mar 2009, 10:46 PM
ver 1.2.3

ColumnModel cm = new ColumnModel(new ArrayList<ColumnConfig>());
ListStore<BaseModel> store = new ListStore<BaseModel>();
EditorGrid<BaseModel> grid = new EditorGrid<BaseModel>(store, cm);

BaseModel model = new BaseModel();
model.set("name", "test0");

grid.getStore().add(model);
grid.getSelectionModel().select(0);

model.set("name", "test1");
grid.getStore().update(model);
BaseModel model0 = grid.getSelectionModel().getSelectedItem();
assertEquals(model.get("name"), model0.get("name"));