How do I select a newly added row in a grid programmatically after I add in it?
I've tried using the following but nothing was selected.
ModelData model = getDefaultModel(); // get a new default model
Grid<ModelData> grid = getGrid(); // grid with remote data
ListStore<ModelData> listStore = grid.getStore();
...
// code that adds the model to the remote data store
...
listStore.add(model); // I don't want to reload everything just for adding this one thing
GridSelectionModel<ModelData> gridSelectionModel = grid.getSelectionModel();
gridSelectionModel.select(model,false);
I run into the same problem. After calling selectionModel.select(desiredRowIndex, false), I cannot see the RowClick event get fired. I resolved this issue by calling the code inside the event handler of RowClick right after calling selectionModel.select(desiredRowIndex, false).
I run into the same problem. After calling selectionModel.select(desiredRowIndex, false), I cannot see the RowClick event get fired. I resolved this issue by calling the code inside the event handler of RowClick right after calling selectionModel.select(desiredRowIndex, false).