GWT:DataGrid - 设置高度 100% 未正确呈现 [英] GWT: DataGrid - set height 100% not rendering properly
问题描述
我正在使用布局面板和数据网格.当我将数据网格高度设置为 100% 时,网格不会呈现.我的面板层次结构如下图
I am working with layout panels and datagrid. When I set the datagrid height to 100%, Grid is not rendering. My panel hierarchy looks like the following image
我做得对还是我搞砸了面板层次结构???
Am I doing it properly or I messed up the panel hierarchy???
父面板是简单的布局面板,里面我有拆分布局面板 -> 滚动面板 -> 数据网格
Parent panel is the simple layout panel, inside that I have split layout panel -> scrollpanel -> datagrid
推荐答案
DataGrid
需要放在一个 LayoutPanel
或 Panel
实现ProvidesResize
界面可见.ScrollPanel
实现了该接口.
DataGrid
requires to be put in a LayoutPanel
or Panel
that implements the ProvidesResize
interface to be visible. ScrollPanel
implements that interface.
此外,从您的 DataGrid
到根元素/面板的这个 LayoutPanels
链必须是完整的.在您的面板层次结构中似乎就是这种情况.
Furthermore this chain of LayoutPanels
from your DataGrid
up to your root element/panel has to be unbroken. That seems to be the case in your panel hierarchy.
最后,您必须使用 RootLayoutPanel
而不是 RootPanel
来添加您的 LayoutPanels
.
那么您是否确保将 SimpleLayoutPanel
添加到 RootLayoutPanel
中?
Finally you have to use the RootLayoutPanel
instead of the RootPanel
to add your LayoutPanels
.
So did you make sure that you add your SimpleLayoutPanel
to the RootLayoutPanel
?
这篇关于GWT:DataGrid - 设置高度 100% 未正确呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!