javascript - 卡片布局面板未在 Sencha Touch 2.2 中呈现

标签 javascript cordova extjs sencha-touch sencha-touch-2

我使用 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/

相关文章:

extjs - 在 extjs4.1 的服务器端过滤存储

android - PhoneGap 1.3 到 1.5 升级

javascript - 如何在 Cordova PhoneGap 应用程序中打开设置-> iPhone 的隐私

javascript - SQLite 查询在 JavaScript 中执行搜索和多个过滤器

javascript - 如何在5中升级extjs 3.4项目

javascript - 用onclick动态创建元素只执行最后一个元素

javascript - Azure 上 JavaScript 文件的策略

Javascript REGEX 从 url 中获取 5 个字符

javascript - 通过 HTTP GET 传递多个参数

javascript - 处理单击 Ext.js 面板标题