0

我遇到了 extjs 4 类模型的问题。我想在视口中获得一个标签面板。我通过定义自己的元素并使用 xcode 自动加载它来运行它。但我没有在父类本身内完成它。

Ext.define('MyApp.views.TheWindow', {
    extend  : 'Ext.Viewport',
    requires: [],
    border  : false,
    layout  : {
        type    : 'fit'
    },
    initComponent : function() {
        this.items  = this.buildItems();
        this.callParent();
    },
    buildItems : function() {
        return [
            {
                extend: 'Ext.TabPanel',
                activeTab: 0,
                alias: 'widget.MyTapPanel',
                items: [
                    {

                        title: 'Artikel Manager',
                        html: 'test' 
                        /*items: [
                            {
                            }
                        ]*/
                    },
                    {
                        title: 'Artikel Manager',
                        html: 'test' 
                        /*items: [
                            {
                            }
                        ]*/
                    }
                ]
            }

        ];
    }
});

我的代码有什么问题?

4

1 回答 1

0

代替

extend: 'Ext.TabPanel',

xtype: "tabpanel"

而且您不需要定义别名,因为您没有定义新类(Ext.define),而只是定义了项目confgi。

于 2011-08-12T09:55:56.430 回答