简体   繁体   English

Ext JS tabpanel不适合窗口大小

[英]Ext JS tabpanel won't fit window size

Someone wants a panel done in Ext JS to dynamically fit the window size. 有人想在Ext JS中完成一个面板来动态调整窗口大小。 I'm not familiar with Ext, but after hours of searching, I haven't found a working solution. 我不熟悉Ext,但经过几个小时的搜索,我还没有找到一个有效的解决方案。 Here is the code that is expected to be fixed: 以下是预计要修复的代码:

var histotab = Ext.createWidget('tabpanel', { 
         activeTab: 0,
     width : 2000,
     height : "50%",
     defaults :{
         bodyPadding: 10
     },
    items: [
        {
           id: 'chartCmp',
           title: 'By Year',
           xtype: 'chart',
           style: 'background:#fff',
           layout:'fit',
           animate: true,
       shadow: true,
           store:SOD.storeHistogram,
           axes: [{
        type: 'Numeric',
        position: 'left',
        fields: ['countoffiles'],
        label: {
            font: '8px Arial'
        },

Any suggestions are greatly appreciated. 任何建议都非常感谢。

Use the Ext.container.Viewport class with a fit layout. 使用具有适合布局的Ext.container.Viewport类。 The viewport always sizes itself to the document view size. 视口始终将自身调整为文档视图大小。

Ext.widget('viewport', {
    layout: 'fit',
    items: {
        xtype: 'tabpanel',
        items: [{
            title: 'Foo',
            html: 'First tab'
        }]
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM