javascript - ExtJS 3.4 : Render buttons in hidden tabpanel

标签 javascript extjs tabpanel buttongroup

在 ExtJs 3.4 中,我有一个带有两个选项卡的 TabPanel,第二个选项卡包含一个 FormPanel,其中包含一个 ButtonGroup。如果第二个选项卡处于事件状态,当我加载页面时,一切都很好,但是当第一个选项卡处于事件状态并且我切换到第二个选项卡时,按钮组中没有按钮,只有标签。这是代码:

var tabs = new Ext.TabPanel({
    renderTo: 'tabs',
    width:500,
    forceLayout: true,
    activeTab: 0,
    deferredRender: false,
    defaults:{autoHeight: true},
    items:[
        {contentEl:'tab1', title: 'Tab1'},
        {contentEl:'tab2', title: 'Tab2'}
    ]
});

var form = new Ext.form.FormPanel({
    width   : 400,
    autoHeight: true,
    renderTo: 'form',
    bodyStyle: 'padding: 5px',
    items: [
        {
            xtype: 'buttongroup',
            fieldLabel: 'Label',
            items: 
            [
                {
                    xtype: 'button',
                    text: 'Find By User',
                    width: 100,
                    scope: this,
                    handler: this.handleFind
                },
                {
                    xtype: 'button',
                    text: 'Find All',
                    width: 100,
                    scope: this,
                    handler: this.handleFindAll
                }
            ]
        }
    ]
});

我设置了 deferredRender: falseforceLayout: true,还尝试了 hideMode: 'offsets',但这些没有帮助.

最佳答案

嗯,我将 hideMode: 'offsets' 添加到 TabPaneldefaults 中,效果很好。几年前我也做了同样的事情,但没有取得显着的结果。

关于javascript - ExtJS 3.4 : Render buttons in hidden tabpanel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17761867/

相关文章:

javascript - JQuery 忽略 .not() 函数

javascript - ExtJS 从多个代理源填充存储

JavaFX,在选项卡 Controller 之间传递参数

Gwt, TabPanel, TabLayoutPanel & Custom Tab using TabBar +DeckLayoutPanel的困境

apache-flex - Flex 4 中的垂直选项卡

javascript - 在javascript中添加HTML标签

javascript - 将 admob 广告实现到 Cordova Javascript 应用程序中

javascript - 有 Angular ,难以获得工作指令

javascript - Sencha extjs 5 在 West 布局中显示树

extjs - 如何从 Ext 窗口文本字段获取用户输入值?