为什么我的 tabPanel 中的 gridPanel 显示错误的高度?

发布于 2024-11-04 11:07:04 字数 1368 浏览 3 评论 0原文

在此处输入图像描述

在所附图像中,网格未正确显示。网格位于选项卡面板内。选项卡的布局为=“适合”。

是什么设置错误导致了该行为? 编辑: 以下是选项卡面板的类定义: 我们的选项卡是“外部 ID”选项卡

/*
 * File: SomeTabPanel.ui.js
 * Date: Mon May 02 2011 18:08:34 GMT-0400 (Eastern Daylight Time)
 * 
 * This file was generated by Ext Designer version xds-1.0.3.2.
 * http://www.extjs.com/products/designer/
 *
 * This file will be auto-generated each and everytime you export.
 *
 * Do NOT hand edit this file.
 */

SomeTabPanelUi = Ext.extend(Ext.TabPanel, {
   activeTab: 0,
   forceLayout: true,
   border: false,
   enableTabScroll: true,
   initComponent: function() {
      this.items = [{
         xtype: 'panel',
         title: 'General',
         layout: 'table',
         tpl: '',
         ref: 'GeneralTab',
         layoutConfig: {
            columns: 2
         },
         items: [{
            xtype: 'form',
            title: 'Corporate',
            height: 500,
            width: 500,
            animCollapse: false,
            items: [{
               xtype: 'box',
               ref: '../../coporateBox'
            }]
         }]
      },{
         xtype: 'panel',
         title: 'External ID',
         layout: 'fit',
         ref: 'ExtIdTab',
         id: ''
      }];
      SomeTabPanelUi.superclass.initComponent.call(this);
   }
});

enter image description here

In the attached image, the grid does not show properly. The grid is inside a tabpanel. The layout of the tab is = 'fit'.

What setting error is causing the behavior?
EDIT:
Here is the class definition for the tabpanel: Our tab is the one called 'External ID'

/*
 * File: SomeTabPanel.ui.js
 * Date: Mon May 02 2011 18:08:34 GMT-0400 (Eastern Daylight Time)
 * 
 * This file was generated by Ext Designer version xds-1.0.3.2.
 * http://www.extjs.com/products/designer/
 *
 * This file will be auto-generated each and everytime you export.
 *
 * Do NOT hand edit this file.
 */

SomeTabPanelUi = Ext.extend(Ext.TabPanel, {
   activeTab: 0,
   forceLayout: true,
   border: false,
   enableTabScroll: true,
   initComponent: function() {
      this.items = [{
         xtype: 'panel',
         title: 'General',
         layout: 'table',
         tpl: '',
         ref: 'GeneralTab',
         layoutConfig: {
            columns: 2
         },
         items: [{
            xtype: 'form',
            title: 'Corporate',
            height: 500,
            width: 500,
            animCollapse: false,
            items: [{
               xtype: 'box',
               ref: '../../coporateBox'
            }]
         }]
      },{
         xtype: 'panel',
         title: 'External ID',
         layout: 'fit',
         ref: 'ExtIdTab',
         id: ''
      }];
      SomeTabPanelUi.superclass.initComponent.call(this);
   }
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏末的微笑 2024-11-11 11:07:04

看起来您需要以某种方式设置网格的高度。手动高度声明 autoHeight: true 或从父容器继承的高度。

父 tabPanel 是否声明/继承了高度?

设置 layout: 'fit' 对于包含选项卡来说是一个良好的开始,但如果没有一些代码或测试用例,我就无法提供更多帮助。

Looks like you need to set a height for the grid somehow. Either a manual height declaration, autoHeight: true, or inherited height from a parent container.

Does the parent tabPanel have a height declared/inherited?

Setting layout: 'fit' is a good start for the containing tab, but without some code or a test case, I can't be more helpful.

救星 2024-11-11 11:07:04

它应该按照描述工作,所以你的代码一定有问题。如果您需要更多帮助,请发布您的布局代码。

It should work as described, so you must have something wrong in your code. Post your layout code if you want more help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文