PDA

View Full Version : how to reload a store and avoid loop



ibagur
21 Jun 2011, 4:40 PM
Dear all,

I got a GridPanel with a RowSelectionmodel. When I select a row, the data related to this row is displayed on a Form, so the user can change its values. So far no problem with this, but I also want the Grid store to be reloaded, so the Grid will refresh the rows in case another user of the application has updated any other row.

The problem is that everytime I select a row I get in a nasty 'reloading' loop, that slows down everything and it does not even allow me to change and update the values in the form



MyGrid.getSelectionModel().addListener({
rowselect: function(sm, rowIdx, record) {
// Load row data in the form
MyForm.getForm().loadRecord(record);

// I want to refresh this same grid
MyGrid.store.reload();
}
});


Is there any way to make this work? Is there another event related to GridPanel where I can put the store.reload to avoid this loop?

Thanks

ibagur
21 Jun 2011, 6:36 PM
Hi,

It's me again. I just found a solution to this. Instead of putting the 'store.reload' within the 'rowslect' event, I've just put it under the 'rowdeselect' event, and now it's working as I wanted.



rowdeselect: function() {
gridEntrevistas.store.reload();
}