Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 为什么我的xtypes在Sencha touch 2.0 final中不起作用?_Sencha Touch_Sencha Touch 2 - Fatal编程技术网

Sencha touch 为什么我的xtypes在Sencha touch 2.0 final中不起作用?

Sencha touch 为什么我的xtypes在Sencha touch 2.0 final中不起作用?,sencha-touch,sencha-touch-2,Sencha Touch,Sencha Touch 2,嘿,我一直在想以下问题: 在我以前的应用程序中,我为我的类指定了一个xtype,如下所示: Ext.define('Sencha.view.Home', { extend: 'Ext.Panel', xtype: 'homepanel', 然后在我的视口中,我在项目中添加了“homepanel”的xtype,当然效果很好,homepanel和其他内容都显示在我的视图中。但升级到2.0决赛后,我不能再这样做了?不,我必须这样使用它才能将我的homepanel包含在视图中: xclass: 'S

嘿,我一直在想以下问题: 在我以前的应用程序中,我为我的类指定了一个xtype,如下所示:

Ext.define('Sencha.view.Home', {
extend: 'Ext.Panel',
xtype: 'homepanel', 
然后在我的视口中,我在项目中添加了“homepanel”的xtype,当然效果很好,homepanel和其他内容都显示在我的视图中。但升级到2.0决赛后,我不能再这样做了?不,我必须这样使用它才能将我的homepanel包含在视图中:

xclass: 'Sencha.view.Home'

这是版本的变化吗?我现在是否总是必须调用xclass,或者我的xtype是否有问题?谢谢你的帮助

对于声明,Sencha框架有一个别名关键字而不是xtype

这也是EXTJS现在的做法:

我有一个Sencha Touch 2.0应用程序,我的视口设置如下:

Ext.define('example.view.Viewport', {
    extend: 'Ext.Container',
    config: {
        fullscreen: true,
        id: 'mainContainer',
        layout: {
            type: 'card',
            animation: {}//we manually set this throughout the app
        },
        items: [
            /*
             * This is a list of all of the "cards" in our app that are preloaded
             */
            { xtype: 'dashboardpanel' },
            { xtype: 'customerlist' },
            { xtype: 'loginpanel' }
        ]
    }
});

所以如果你的不起作用,我猜还有别的事情发生。但是如果没有看到更多的代码,就很难说了。

所以我发现了我的xtypes的错误:我在控制器中声明了我的视图,而不是在App.js中声明,因为我已经将它们放在App.js中了,所有这些都对我很好! 谢谢你的帮助

Ext.define('Sencha.view.Home', {
extend: 'Ext.Panel',
alias: 'widget.homepanel'

当您想使用alias小部件“homepanel”时,只需说xtype:“homepanel,无论您想在哪里实现它”

只要将容器更改为“从面板列表”,并将列表配置设置为

 scrollable: false,
 pinHeaders: false,

您还可以显示项目是如何配置的吗?控制器和存储是如何设置的,因为这不需要。我在我的主视图中尝试过:'alias:'widget.homepanel',我在主视图中用'alias:'homepanel'调用它,但它什么也没有显示:/n您将它用作xtype:homepanel,但将它声明为别名
 scrollable: false,
 pinHeaders: false,