Invisible DataGrid

124 views
Skip to first unread message

walker1c

unread,
Oct 14, 2011, 11:41:44 AM10/14/11
to Google Web Toolkit
Can anyone point me to a working example that uses
com.google.gwt.user.cellview.client.DataGrid?

The example code in the Javadoc relates to a different widget
(CellTable). The code in the GWT showcase is incomplete and seems to
be full of dependencies related to the showcase infrastructure.

I've pulled the complete showcase code for this widget from SVN and
modified it to remove the dependencies. What I get is a page with a
pager at the bottom showing the correct number of records, but no
DataGrid at all. As far as I can tell from inspecting the page in
Firebug, it never gets rendered.

Jeff Larsen

unread,
Oct 14, 2011, 12:23:21 PM10/14/11
to google-we...@googlegroups.com
DataGrid needs to live inside a LayoutPanel

Sudhakar Abraham

unread,
Oct 15, 2011, 2:49:18 AM10/15/11
to Google Web Toolkit
Add your DataGrid in panels like HTMLPanel, HorizontalPanel etc..,.

S. Abraham
www.DataStoreGwt.com
Persist objects directly in Google App Engine

walker1c

unread,
Oct 17, 2011, 5:42:09 AM10/17/11
to Google Web Toolkit
Many thanks for your replies, Jeff and Sudhakar.

The ui.xml I'm using at the moment embeds the DataGrid in a
ResizeLayoutPanel (see below). I've tried substituting HTMLPanel and
HorizontalPanel, and I've also tried removing the pager so that the ui
just consists of a DataGrid in a HTMLPanel. It's still not visible.

I was hoping to see an example of a DataGrid working outside the
context of the showcase so that I could work out how it differs from
what I'm doing. In the absence of examples of use, I'm beginning to
think this component is probably too new for production use.

Chris

<g:DockLayoutPanel unit="EM">
<!-- DataGrid. -->
<g:center>
<g:ResizeLayoutPanel>
<c:DataGrid ui:field='dataGrid' />
</g:ResizeLayoutPanel>
</g:center>

<!-- Pager. -->
<g:south size="3">
<g:HTMLPanel>
<table style="width:100%">
<tr>
<td align='center'>
<c:SimplePager ui:field='pager' />
</td>
</tr>
</table>
</g:HTMLPanel>
</g:south>
</g:DockLayoutPanel>

Jeff Larsen

unread,
Oct 17, 2011, 10:11:02 AM10/17/11
to google-we...@googlegroups.com
Remove the ResizeLayoutPanel from the DockLayoutPanel and it should work. 
Reply all
Reply to author
Forward
0 new messages