javascript - ExtJS 自动调整大小选项卡面板

标签 javascript extjs extjs4.1

我们有一个视口(viewport),其中有一个用于导航树的西部区域和一个用于内容(网格、表单等)的中心区域,其中有一个选项卡面板位于其中。

通过单击导航树中的任何子菜单项,我们可以动态地将内容(选项卡)添加到此选项卡面板。

这些选项卡不会在窗口大小调整时调整大小。

动态添加标签的函数是:

function AddNewTab(title, url, closable) {
    var tabs = Ext.getCmp('tabs');
    tabs.add({
        xtype: 'panel',
        title: title,
        closable: closable,
        autoScroll: true,
        layout: 'fit',
        autoLoad: {
            url: url,
            scripts: true
        }
    });
    tabs.setActiveTab(tabs.items.length - 1);
}

更新: 这是一切正常的正常状态 This is the normal state where every things is OK

但是当我们调整窗口大小或折叠右侧面板时,选项卡面板不会调整大小以填充整个区域。 But when we resize the container, tab panel won't re-size to fill the whole area.

最佳答案

中心区域的布局应该是 'fit' 。

关于javascript - ExtJS 自动调整大小选项卡面板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12263035/

相关文章:

javascript - Ext splitter - 以编程方式更改其位置

javascript - 在extjs中合并两个不同的json对象

javascript - 解决错误: Cannot read property 'style' of null"with a better approach?

javascript - Ajax 请求 - 仅获取/加载 Div Id

javascript - 如何在 Extjs 中更改 Treepanel 中访问的节点颜色,就像我们在 html 中一样

javascript - extjs 示例代码不起作用

javascript - 使用 `nsIWebBrowserPersist saveURI` 或 Firefox 扩展中的其他内容重新启动下载?

javascript - 在 Chrome 应用程序沙箱中加载脚本文件

javascript - 扩展 Sencha Touch 对象

extjs - 单击蒙版时如何关闭模态窗口extjs?