ExtJS Auto Resize Tab Panel

老子叫甜甜 提交于 2019-12-12 04:10:06

问题


We have a viewport, and inside it we have a west region for navigation tree and a center region for content (grids, forms, etc.) which has a tab panel inside it.

We dynamically add content (tabs) to this tab panel, on click of any sub-menu item in navigation tree.

These tabs are not re-sized on window re-size.

The function to add tabs dynamically is:

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

Update: This is the normal state where every things is OK

But when we resize the window or collapse the right panel, tab panel won't re-size to fill the whole area.


回答1:


The layout of the center region should be 'fit' .




回答2:


This helped me out.

Ext.EventManager.onWindowResize(myEvilPanel.doLayout, myEvilPanel);


来源:https://stackoverflow.com/questions/12263035/extjs-auto-resize-tab-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!