Reputation: 2995
I'm using Sencha Architect, and have yet to figure out how to get my TabPanel content to take up 100% of the container that the TabPanel lives in.
This is the code I'm using now:
Ext.define('MyApp.view.MyViewport', {
extend: 'Ext.container.Viewport',
layout: {
type: 'border'
},
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'container',
region: 'north',
height: 60
},
{
xtype: 'container',
region: 'center',
items: [
{
xtype: 'tabpanel',
activeTab: 0,
items: [
{
xtype: 'panel',
layout: {
type: 'fit'
},
title: 'Tab 1',
items: [
{
xtype: 'panel',
title: 'My Panel'
}
]
},
{
xtype: 'panel',
title: 'Tab 2'
},
{
xtype: 'panel',
title: 'Tab 3'
}
]
}
]
}
]
});
me.callParent(arguments);
}
});
I'm completely at a loss as to how to achieve this, and I haven't been able to find the answer in the Ext.js documentation.
Upvotes: 0
Views: 2131
Reputation: 30082
Over-nesting. If you have a container without a layout, you're more often than not, doing something wrong:
Ext.define('Foo', {
extend: 'Ext.container.Viewport',
layout: 'border',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [{
xtype: 'container',
region: 'north',
height: 60
}, {
region: 'center',
xtype: 'tabpanel',
activeTab: 0,
items: [{
title: 'Tab 1',
html: 'Tab 1'
}, {
xtype: 'panel',
title: 'Tab 2',
html: 'Tab 2'
}, {
xtype: 'panel',
title: 'Tab 3',
html: 'Tab 3'
}]
}]
});
me.callParent(arguments);
}
});
Ext.onReady(function(){
new Foo();
});
Upvotes: 2