繁体   English   中英

如何设置ExtJs网格的高度?

[英]How to set height to ExtJs Grid?

我有以下结构:

TabPanel->FormPanel->Grid

在此处输入图片说明

我想将网格的高度设置为formpanle上的所有可用空间。 如果我说layout:在FormPanle的第一个文本字段中适合`获得formpanel的所有空间。 我该怎么办?

FormPanel:

var search = new Ext.FormPanel({
                labelAlign: 'top',
                frame:true,
                title: 'Поиск',
                //layout:'fit',
                viewConfig:{ forceFit: true },
                //bodyStyle:'padding:5px 5px 0',

GridPanel:

var searchTab = new Ext.grid.GridPanel({
    store: searchStore,
    region: 'center',
    cm: searchCm, 
    layout:'fit',
    selModel: new Ext.grid.RowSelectionModel(),
    stripeRows : true,
    height: 390,
    autoExpandColumn:'expColumn',
    loadMask: true,
    id: 'searchTab',
    title:'Найденные объекты',
    autoScroll: true,

用户borderLayout并分别位于2个Region.North和center中。 在北部区域添加顶部面板内容,在中央区域添加网格。

layout: 'border',
        items: [{
            title: 'North Region is resizable',
            region: 'north',     // position for region
            xtype: 'panel',
            height: 100
        },{
            title: 'Center Region',
            region: 'center',     // center region is required, no width/height specified
            xtype: 'panel',
            layout: 'fit',
            items: {
                new Ext.grid.GridPanel({
                    store: searchStore,
                    region: 'center',
                    cm: searchCm, 
                    layout:'fit',
                    selModel: new Ext.grid.RowSelectionModel(),
                    stripeRows : true,
                    height: 390,
                    autoExpandColumn:'expColumn',
                    loadMask: true,
                    id: 'searchTab',
                    title:'????????? ???????',
                    autoScroll: true
                })
            }
        }]

固定文本字段的高度,并尝试为gridpanel设置高度:“ 100%”。 Sushant Jain的解决方案很好,但在高度方面也是如此:如果您想让网格占据剩余区域,则可以选择'100%'。 区域:“中心”有助于按北部区域占据剩余区域,但是如果您固定高度或宽度,即使中心区域扩展为占据剩余区域,网格面板也将保持固定高度。

暂无
暂无

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

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