0

我正在尝试在小部件中实现 TAB 面板。

我可以看到它,但完全在错误的地方......这是查看代码我如何将它放在widget.TESTusersettings????

我想 renderTo:Ext.getBody()在这里不正确......你是什么意思?

Ext.define("TEST.view.settings.UserSettings", {
    extend: "Ext.window.Window",
    alias: "widget.TESTdusersettings",

    requires: [
        "TEST.overrides.LocalComboBox",
        "TEST.common.LocaleManager",
        "Ext.form.Panel"
    ],

    width: 600,
    height: 300,
    border: false,
    closeAction: "hide",
    resizable: false,

    layout: "fit",

    title: 'User Settings',


    initComponent: function() {
        debugger;
        Ext.create('Ext.tab.Panel', {
            width: 300,
            height: 200,
            activeTab: 0,
            items: [
                {
                    title: 'Userdata',
                    bodyPadding: 10,
                    html: 'A simple tab'
                },
                {
                    title: 'Connections',
                    html: 'Connections one'
                },
                {
                    title: 'Payment',
                    html: 'Payment one'
                },
                {
                    title: 'Bills',
                    html: 'Bills one'
                }
            ],
            renderTo: Ext.getBody()
        });
    }

});
4

1 回答 1

2

将 init 更改为此。

initComponent: function() {
    var me = this;
    Ext.applyIf(me, {
        items: Ext.create('Ext.tab.Panel', {
            activeTab: 0,
            items: [
                {
                    title: 'Userdata',
                    bodyPadding: 10,
                    html: 'A simple tab'
                },
                {
                    title: 'Connections',
                    html: 'Connections one'
                },
                {
                    title: 'Payment',
                    html: 'Payment one'
                },
                {
                    title: 'Bills',
                    html: 'Bills one'
                }
            ]
        })
    });

    me.callParent(arguments);
}
于 2013-08-14T12:04:39.477 回答