簡體   English   中英

如何使用extjs在Widget中實現Tab面板?

[英]how to implement Tab panel inside Widget with extjs?

我正在嘗試在小部件中實現TAB-panel。

我可以看到它,但完全在錯誤的地方...這里是VIEW的代碼我怎么能把它放在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()
        });
    }

});

將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);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM