PDA

View Full Version : AfterAdd event from Store or Gridview?



chrismcnally
30 Jul 2009, 9:26 AM
I am inserting a row into the grid and I want to select it after it has been inserted and is rendered on the screen.

I used a StoreListener to catch the add event:

grid.getStore().addStoreListener( new StoreListener<ModelData>() {

@Override
public void storeAdd(StoreEvent<ModelData> se) {
// select the row here, other actions possible
}

This does not work though because my listener is called before the GridView's listener which adds the row to the view.

I was hoping that the GridView would fire an AfterAdd event when the row was available on the screen. What would be the best method for getting some code triggered after the add is complete?

Thanks in advance

chris m

sven
30 Jul 2009, 9:29 AM
You could listen to the add event like now and just use a DeferredCommand to defer the actions