GWT Datagrid does not show data , but contains it

安稳与你 提交于 2019-11-28 08:34:09
Abhijith Nagaraja

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 ?

Also refer to this GWT: DataGrid - set height 100% not rendering properly

Lucas A.

Here are my 2 cents.

When it comes to render a DataGrid outside of a properly formed "LayoutPanel or Panel that implements the ProvidesResize" tree structure, I found out I always need to keep the following in mind:

  1. As this question explains, the height DataGrid property needs an explicit value, for example, "123px". Without this, DataGrid does not show its data rows (even if they are in the DOM).

  2. If put a DataGrid inside an unfocused DecoratedTabPanel tab, DataGrid.redraw() needs to be called when such tab gets focus . Again, without this, DataGrid does not show its data rows (even if they are in the DOM).

I hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!