我正在尝试在TabPanel中的选项卡内显示一个列表。当我只显示列表时 - 它工作正常,但是当我把它放在TabPanel里面时它没有显示。
在启动事件中使用此代码时显示:
Ext.create('Ext.List', {
fullscreen: true,
itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>',
store: cityStore
});
当我使用此代码时,它将不显示(尽管选项卡显示为需要)。我也尝试在项目中包含Ext.create列表,结果仍然相同。
Ext.create('Ext.TabPanel',{
fullscreen: true,
tabBarPosition: 'bottom',
scrollable: true,
items: [
{
title: 'Home',
iconCls: 'home',
html: ['Welcome to my Pizza!'].join(""),
style: 'text-align: center;'
},
{
title: 'Search',
iconCls: 'search',
items: [
Ext.create('Ext.List', {
fullscreen: true,
itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>',
store: cityStore
})
]
},
{
xtype: 'toolbar',
title: 'Pizza',
dock: 'top'
}
]
}).setActiveItem(1); // this is set for debugging only
可能有什么不对?谢谢!
答案 0 :(得分:5)
在Sencha论坛上解决了问题:
您正在将列表嵌套在面板中。试着去除它:
代码:
Ext.create('Ext.tab.Panel',{
fullscreen: true,
tabBarPosition: 'bottom',
scrollable: true,
items: [
{
title: 'Home',
iconCls: 'home',
html: ['Welcome to my Pizza!'].join(""),
style: 'text-align: center;'
},
{
xtype: 'list',
title: 'Search',
iconCls: 'search',
store: cityStore,
itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>'
},
{
xtype: 'toolbar',
title: 'Pizza',
dock: 'top'
}
]
}).setActiveItem(1);