PDA

View Full Version : i have some problem about size of tabpanel



nianjcn
6 Dec 2010, 7:46 AM
hi,

i am a new one to sencha,i am trying to implement a ui which uses a panel as the top level container and a tabpanel & a toolbar as its child item.but the tabpanel has some problem with its size(can not display the content of each tab,but the tabbar is ok).any body can help me?

here is my code ,thanks


var mainframe = new Ext.Panel({
'fullscreen':true,
'layout':'auto',
'cls':'c-mainframe',
'items':[
{
'xtype':'toolbar',
'title':' ',
'cls':'c-toolbar',
'titleCls':'c-toolbar-title'
},
{
'xtype':'panel',
'items':[
{
'title':'1',
'html':'1'
},
{
'title':'2',
'html':'2'
}
]
}
]
})

Fredric Berling
6 Dec 2010, 12:38 PM
Shouldnt it be tabpanel instead of panel?


var mainframe = new Ext.Panel({
'fullscreen':true,
'layout':'auto',
'cls':'c-mainframe',
'items':[
{
'xtype':'toolbar',
'title':' ',
'cls':'c-toolbar',
'titleCls':'c-toolbar-title'
},
{
'xtype':'tabpanel',
'items':[
{
'title':'1',
'html':'1'
},
{
'title':'2',
'html':'2'
}
]
}
]
})

mrsunshine
6 Dec 2010, 2:16 PM
Try this:


Ext.setup({
onReady: function() {
new Ext.TabPanel({
fullscreen: true,
dockedItems: [
{
xtype: 'toolbar',
docked: 'top',
title: 'toolbar'
}
],
items: [
{
'title':'1',
'html':'1'
},
{
'title':'2',
'html':'2'
}

]

});
}
});

mrsunshine
6 Dec 2010, 2:17 PM
you can dock the toolbar the top and use a tabPanel as outer container



Ext.setup({
onReady: function() {
new Ext.TabPanel({
fullscreen: true,
dockedItems: [
{
xtype: 'toolbar',
docked: 'top',
title: 'toolbar'
}
],
items: [
{
'title':'1',
'html':'1'
},
{
'title':'2',
'html':'2'
}

]

});
}
});