如何设置 GWT 网格的高度?

发布于 2025-01-06 08:05:03 字数 225 浏览 5 评论 0原文

我们正在使用 GWT 2.4.0。我们在我们的应用程序中使用网格。但我们无法设置网格的高度。作为参考,请查看下图: 在此处输入图像描述

在上图中,您可以发现左侧带有网格的列表框有很多选项。但是我们只需要显示 10 个带有滚动条的项目。有什么办法可以实现这一点吗?请给我正确的方向。

如有帮助,将不胜感激。

We are using GWT 2.4.0. We are using Grid in our application. But we are not able to set height of a grid.For reference,please have a look into the following image:
enter image description here

In the above image,you can find the listbox with grid in the left side having a lot options.But we need to display only 10 items with scroll bar.Is there any way to achieve this?Throw me in right direction.

Help would be appreciated.

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

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

发布评论

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

评论(2

北风几吹夏 2025-01-13 08:05:04

你尝试过一些CSS规则吗?

示例:

#myid {
    overflow: auto;
    height: 450px;
}

编辑:

如果您使用的是 ListBox (http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/列表框.html)

lb.setVisibleItemCount(10);

Have you tried with some css rules?

Example:

#myid {
    overflow: auto;
    height: 450px;
}

EDIT:

if you are working with ListBox (http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/ListBox.html)

lb.setVisibleItemCount(10);
网白 2025-01-13 08:05:04
 listBox.setVisibleItemCount(10);
 listBox.setVisibleItemCount(10);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文