I have two grids nested in a panel with an anchor layout, something like this:
var tabs = Ext.widget('tabpanel', {
layout: 'fit',
activeTab: 0,
plain: true,
margin: 1,
items: [gridOne, gridTwo]
});
var gridOne = {
xtype: 'grid',
id: 'gridOne',
collapsible: true,
border: 1,
anchor: '100% 50%',
enableColumnMove: false,
colModel: colModel,
store: storeOne,
listeners: {
scope: this,
collapse: function() {
var obj = Ext.getCmp('gridTwo');
Ext.apply(obj, {anchor: '100% 100%'});
obj.doLayout()
}
}
};
var gridTwo = {
xtype: 'grid',
id: 'gridTwo',
collapsible: true,
border: 1,
anchor: '100% 50%',
enableColumnMove: false,
colModel: colModel,
store: storeTwo
};
As you might imagine, these are two grids laid out with gridOne
on top of gridTwo
. Both are collapsible. As you can see from the listener in gridOne
, I would like to extend the height of gridTwo
to take up the entire height of the parent container when grid one is collapsed.
The listener code in gridOne
is what I think should work but it is not. I have also thought about using the Accordion layout but I'm not sure that I can get the effect of having two grids on top of each other like I can with the Anchor layout.
So my question boils down to how I can extend the height of gridTwo
to 100% of the parent container when collapsing gridOne
.