strickjb
13 Dec 2011, 1:00 PM
I have a viewport setup w/ 3 regions - north, south, center.
In the north region, I have a panel (xtype: 'commoninfo') that has a form being populated via an AJAX call. Any fields that have empty values are hidden (w/ display: none).
By the time the form is populated, the viewport + descendants have all rendered so that when I hide fields in the 'commoninfo' panel - it screws up the look (aka a nasty gap between north/center regions).
Is there a way to recalculate the viewport after I've made changes to a containing panel?
I've tried Ext.getCmp('viewport').doLayout();
Ext.create('Ext.container.Viewport', {
id: 'viewport',
layout: 'border',
defaults: {
bodyPadding: 15
},
items: [{
xtype: 'container',
region: 'north',
border: false,
items: [{
xtype: 'wheader',
bodyPadding: '15 15 15 80',
border: false
}, {
xtype: 'navigation',
border: false
}, {
xtype: 'commoninfo',
bodyPadding: 15,
bodyStyle: 'border: none; border-bottom: solid 1px #99BCE8;'
}]
}, {
xtype: 'notes',
region: 'south',
collapsible: true
}, {
xtype: 'content',
region: 'center',
items: { xtype: 'filecab' }
}]
});
Disclaimer: I'm pretty new to ExtJS but proficient w/ JavaScript. Don't go easy on me.
In the north region, I have a panel (xtype: 'commoninfo') that has a form being populated via an AJAX call. Any fields that have empty values are hidden (w/ display: none).
By the time the form is populated, the viewport + descendants have all rendered so that when I hide fields in the 'commoninfo' panel - it screws up the look (aka a nasty gap between north/center regions).
Is there a way to recalculate the viewport after I've made changes to a containing panel?
I've tried Ext.getCmp('viewport').doLayout();
Ext.create('Ext.container.Viewport', {
id: 'viewport',
layout: 'border',
defaults: {
bodyPadding: 15
},
items: [{
xtype: 'container',
region: 'north',
border: false,
items: [{
xtype: 'wheader',
bodyPadding: '15 15 15 80',
border: false
}, {
xtype: 'navigation',
border: false
}, {
xtype: 'commoninfo',
bodyPadding: 15,
bodyStyle: 'border: none; border-bottom: solid 1px #99BCE8;'
}]
}, {
xtype: 'notes',
region: 'south',
collapsible: true
}, {
xtype: 'content',
region: 'center',
items: { xtype: 'filecab' }
}]
});
Disclaimer: I'm pretty new to ExtJS but proficient w/ JavaScript. Don't go easy on me.