设置高度100%不能正常渲染

设置高度100%不能正常渲染

本文介绍了GWT:DataGrid - 设置高度100%不能正常渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用布局面板和datagrid。当我将datagrid的高度设置为100%时,Grid不会呈现。我的面板层次结构看起来像下面的图像





我正在做正确的操作,或者我搞砸了面板层次结构?



父面板是简单的布局面板,里面我有拆分布局面板 - > scrollpanel - > datagrid

解决方案

DataGrid 需要放在 LayoutPanel 面板中,实现 ProvideResize 界面可见。 ScrollPanel 实现该界面。



此外,这条 LayoutPanels DataGrid 到您的根元素/面板必须是不间断的。在您的面板层次结构中似乎就是这样。最后,您必须使用 RootLayoutPanel 而不是 RootPanel 添加您的 LayoutPanels

所以你确定你添加了你的 SimpleLayoutPanel RootLayoutPanel


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 requires to be put in a LayoutPanel or Panel that implements the ProvidesResize interface to be visible. ScrollPanel implements that interface.

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.

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%不能正常渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 19:40