我正在使用Sencha Touch 1.1。以下代码构成了视图:
truApp.views.IncidentParentView = Ext.extend(Ext.Panel, {
layout: {
type: 'hbox',
align: 'top'
},
initComponent: function () {
this.sectionStore = Ext.StoreMgr.get(TrafficResponse.Stores.IncidentSections);
this.topToolbar = new Ext.Toolbar({
items: [
{
text: 'Cancel',
ui: 'back',
handler: function() {
Ext.dispatch({
controller: truApp.controllers.incidentController,
action: 'cancel'
});
}
},
{
xtype: 'spacer'
},
{
text: 'Submit',
ui: 'confirm',
handler: function() {
Ext.dispatch({
controller: truApp.controllers.incidentController,
action: 'submit'
});
}
}
]
});
this.dockedItems = [ this.topToolbar ];
this.items = [
{
flex: 1,
dockedItems: [
{
xtype: 'toolbar',
title: 'Sections',
ui: 'light'
}
],
items: [
{
xtype: 'list',
store: this.sectionStore,
scroll: false,
itemTpl: '{Description}',
listeners: {
itemTap: function(dataView, index, item, e) {
var record = dataView.store.getAt(index);
truApp.views.incidentParentView.getComponent('incidentCardPanel').setActiveItem(
index,
{ type: 'slide', direction: 'left' }
);
},
afterrender: function(dataView) {
dataView.getSelectionModel().select(0, false, false);
truApp.views.incidentParentView.getComponent('incidentCardPanel').setActiveItem(
0,
{ type: 'slide', direction: 'left' }
);
}
},
onItemDisclosure: true
}
]
},
{
flex: 3,
id: 'incidentCardPanel',
xtype: 'panel',
layout: 'card',
items: [
{
html: 'card 1'
},
{
html: 'card 2'
},
{
html: 'card 3'
},
{
html: 'card 4'
},
{
html: 'card 5'
},
{
html: 'card 6'
}
]
}
];
truApp.views.IncidentParentView.superclass.initComponent.call(this);
}
});
使用“卡片”布局时,不显示任何内容。当使用'vbox'时,将显示所有6个项目 - 卡1到卡6。
为什么使用卡片布局时项目不显示?
答案 0 :(得分:0)
尝试将fullscreen: true
添加到卡片布局设置中。没有测试,但是我的第一个猜测