GridPanel在窗口调整大小时自动调整大小 [英] Gridpanel auto resize on window resize

查看:198
本文介绍了GridPanel在窗口调整大小时自动调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用array-grid extjs示例来尝试将网格面板安装到容器窗口中.问题在于调整容器窗口的大小,网格面板无法自动适应新的大小.据我了解,这就是它应该如何工作的.

I'm using the array-grid extjs example to try and fit a gridpanel into a container window. The problem is on resizing the container window, the gridpanel doesn't automatically fit the new size. As I understand it that's how it's supposed to work.

这是示例的链接: http://www .extjs.com/deploy/dev/examples/grid/array-grid.html

我所做的更改如下.

// Added to gridpanel config
layout: 'fit',
viewConfig: {
    forceFit: true
}

// Window container
var gridWindow = new Ext.Window({
    items: [
        grid
    ]
});

// Instead of grid.render, use gridWindow.show();
gridWindow.show();

推荐答案

layout: 'fit',

应该进入gridWindow配置!布局管理器排列面板的子级,但是网格 是子级.

should go into the gridWindow configuration! The layout manager arranges the children of a panel, but the grid is the child.

这篇关于GridPanel在窗口调整大小时自动调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆