我使用 sencha touch 2.0 开发了一个应用程序,现在我将应用程序升级到 sencha touch 2.2。 它不工作。 我有一个容器(布局=卡片),如下所示:
Ext.define("InfoImage.view.viewWorkitem.ViewWorkitemView", {
extend:'Ext.Container',
requires:[
'Ext.TitleBar',
'Ext.List'
],
xtype:'workitems',
layout:'card',
cardSwitchAnimation:'slide',
config:{
fullscreen:true,
cls:'hboxpanel',
items:[
{
xtype:'workItemPanel',
flex:3
}
]
} });
workItemPanel 如下:
Ext.define("InfoImage.view.viewWorkitem.WorkitemPanel", {
extend:'Ext.navigation.View',
requires:[
'Ext.TitleBar',
'Ext.List'
],
xtype:'workItemPanel',
id:'workItemId',
config:{
layout : 'card',
style:'border-radius: 10px;',
navigationBar:{
hidden:'true'
},
items:[ ]
} });
这在 sencha tocuh 2.0 中工作正常,但在 2.2 中不行 抛出错误 Uncaught TypeError: Object card has no method 'onItemAdd'
必须进行哪些更改才能使其使用 sencha touch 2.2?
最佳答案
您需要将layout:'card'
、cardSwitchAnimation:'slide'
等配置放在config
block 中:
config:{
layout:'card',
cardSwitchAnimation:'slide',
fullscreen:true,
cls:'hboxpanel',
items:[
{
xtype:'workItemPanel',
flex:3
}
]
}
在第二个 View 中,您的 id:'workItemId'
的方法相同:
config:{
id:'workItemId',
layout : 'card',
style:'border-radius: 10px;',
navigationBar:{
hidden:'true'
},
items:[ ]
}
关于javascript - 卡片布局面板未在 Sencha Touch 2.2 中呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16097355/