PDA

View Full Version : TabPanel with Grid and store



avsomeren
17 Aug 2009, 12:12 PM
Hi all,

Im facing a small problem i've been trying to fix all night without any luck so far.

To give some context ill explain my setup a bit.

I have a Ext.Window with a Ext.grid.Gridview (OrderGrid) and a TabPanel. This TabPanel has 2 tabs which both have a grid within them. On the OrderGrid store load, i select the first record in the store. So far so good ;)

In the rowselect event, i use the code below to try to load the correct data into the grids within the TabPanel. But for some reason, the grid inside the inactive panel does not load/render the data from the store, nor does it render the emptyMsg which I set.



this.getSelectionModel().on('rowselect', function(sm, index, record) {
this.DeleteProductOfferButton.enable();
var grid = Ext.getCmp('order-item-grid');
if (grid != undefined) {
grid.getStore().proxy.setApi('read', 'Order/ListItems/' + record.data.Id);
grid.getStore().reload();
}
var grid = Ext.getCmp('order-history-grid');
if (grid != undefined) {
grid.getStore().proxy.setApi('read', 'Order/ListHistory/' + record.data.Id);
grid.getStore().reload();
}
}, this);


After switching to the panel that was inactive and reselecting a different record from the OrderGrid, it loads up nicely, so is the grid in the previously selected panel.

My hunch is that things arent getting rendered when not active/visible. I have set the deferredRender:false in the TabPanel's config.

Is there anything i might be overlooking?

Regards,
avsomeren