GXT 3网格滚动问题 [英] GXT 3 grid scrolling issue

查看:154
本文介绍了GXT 3网格滚动问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GXT 3.0.0b。

I'm using GXT 3.0.0b.

我在ContentPanel上有一个Grid。当我明确设置ContentPanel的宽度时,滚动没有问题。但是,当我将网格放入VerticalLayoutContainer中时,网格的垂直滚动条消失,只能用鼠标滚轮滚动。

I have a Grid on ContentPanel. When I set ContentPanel width explicitly there is no problem with scrolling. But when I put grid in VerticalLayoutContainer the vertical scrollbar of the grid disappears and scrolling is possible only with mouse wheel.

有人知道如何解决这个问题吗?

Does anybody know how to solve this problem?

推荐答案

最后我设法解决了这个问题。答案很优雅:当我将网格添加到VerticalLayoutContainer时,我应该指定VerticalLayoutData参数。

Finally I've managed to solved this problem. The answer was rather elegant: when I added grid to VerticalLayoutContainer I should specify VerticalLayoutData parameter.

示例:

Example:

verticalLayoutContainer.add(grid, new VerticalLayoutData(1, 1));

您也可以传递分数,例如0.6将宽度(或高度)设置为60%。如果您传递-1,则组件将拥有它自己的默认像素大小。

You can also pass fraction, for example, 0.6 will set width (or height) to 60%. If you pass -1 then component will have it's own default pixel size.

这篇关于GXT 3网格滚动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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