Extjs Sencha touch 2-Can';t将列表嵌套在面板或选项卡面板中
我试图在TabPanel的选项卡内显示列表。当我只是显示列表时,它可以正常工作,但当我将它放在选项卡面板中时,它不会显示 在启动事件中使用此代码时显示:Extjs Sencha touch 2-Can';t将列表嵌套在面板或选项卡面板中,extjs,sencha-touch-2,Extjs,Sencha Touch 2,我试图在TabPanel的选项卡内显示列表。当我只是显示列表时,它可以正常工作,但当我将它放在选项卡面板中时,它不会显示 在启动事件中使用此代码时显示: Ext.create('Ext.List', { fullscreen: true, itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>', store
Ext.create('Ext.List', {
fullscreen: true,
itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>',
store: cityStore
});
Ext.create('Ext.List'{
全屏:对,
itemTpl:“{ID}{Name}”,
商店: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
Ext.create('Ext.TabPanel'{
全屏:对,
tabBarPosition:'底部',
可滚动:对,
项目:[
{
标题:"家",,
iconCls:“家”,
html:[“欢迎光临我的比萨饼!”。加入(“”),
样式:“文本对齐:居中;”
},
{
标题:“搜索”,
iconCls:“搜索”,
项目:[
Ext.create('Ext.List'{
全屏:对,
itemTpl:“{ID}{Name}”,
商店:cityStore
})
]
},
{
xtype:'工具栏',
标题:“披萨”,
码头:“顶部”
}
]
}).setActiveItem(1);//此设置仅用于调试
有什么不对劲吗?谢谢 在Sencha论坛上解决的问题: 您正在将列表嵌套在面板中。尝试取消它: 代码:
Ext.create('Ext.tab.Panel'{
全屏:对,
tabBarPosition:'底部',
可滚动:对,
项目:[
{
标题:"家",,
iconCls:“家”,
html:[“欢迎光临我的比萨饼!”。加入(“”),
样式:“文本对齐:居中;”
},
{
xtype:'列表',
标题:“搜索”,
iconCls:“搜索”,
门店:cityStore,
itemTpl:“{ID}{Name}”
},
{
xtype:'工具栏',
标题:“披萨”,
码头:“顶部”
}
]
}).第(1)项;
您能解释一下“取消”它吗?我也在努力做到这一点。你必须把列表当作一个标签。
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);