How to make CellTable Header always on top

2,100 views
Skip to first unread message

tong123123

unread,
May 29, 2012, 5:15:16 AM5/29/12
to google-we...@googlegroups.com
In my application, I have a scrollpanel and a celltable inside the scrollPanel, most of the column in the celltable is sortable, the problem is that when the record in the celltable is large and when the user scroll down, the celltable header will be hide. is it possible to make the celltable header always on top even we scroll down the content (in current situation, I feel it is impossible)?

currently, the header is created by
celltable.addColumn(column, "headername");

Thomas Broyer

unread,
May 29, 2012, 6:31:57 AM5/29/12
to google-we...@googlegroups.com

Kei Kei

unread,
May 30, 2012, 1:21:14 AM5/30/12
to google-we...@googlegroups.com
When I change my application from using CellTable to DataGrid, then nothing can be shown on the result page!!
then I try to test the example in
http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/com/google/gwt/user/cellview/client/DataGrid.html
with just very minor modification (as attahced as DataGridExample.java, just don't impelement entrypoint and use onLoad),
the data grid cannot be seen also.

So what is the problem?

DataGridExample.java

Kei Kei

unread,
May 30, 2012, 2:14:52 AM5/30/12
to google-we...@googlegroups.com
the data grid cannot be seen also (DataGrid.jpg).
Then I try to replace the DataGrid with CellTable, then the CellTable can be shown!! (as in attached useCellTable.jpg)
useCellTable.jpg
DataGrid.jpg
DataGridExample.java

Kei Kei

unread,
May 30, 2012, 2:40:12 AM5/30/12
to google-we...@googlegroups.com
I see the thread
https://groups.google.com/forum/?fromgroups#!topic/google-web-toolkit/PBhu6RtP4G8
and so I put the datagrid inside a scrollPanel (scrollPanel implements ProvidesResize) and I also set each column width (table.setColumnWidth(addressColumn, 7, Unit.EM);)
but still cannot show the datagrid, what happens?

Thomas Broyer

unread,
May 30, 2012, 2:50:47 AM5/30/12
to google-we...@googlegroups.com

On Wednesday, May 30, 2012 8:40:12 AM UTC+2, tong123123 wrote:
I see the thread
https://groups.google.com/forum/?fromgroups#!topic/google-web-toolkit/PBhu6RtP4G8
and so I put the datagrid inside a scrollPanel (scrollPanel implements ProvidesResize) and I also set each column width (table.setColumnWidth(addressColumn, 7, Unit.EM);)
but still cannot show the datagrid, what happens?

ScrollPanel is also a RequiresResize, so it won't help. You have to give your DataGrid (or whatever RequiresResize+ProvidesResize parent) a size in pixels.

Kei Kei

unread,
May 30, 2012, 3:55:44 AM5/30/12
to google-we...@googlegroups.com
I really get confused.
in my result page, the hierarchy of widget is DialogBox encloses TabLayoutPanel encloses FlexTable, the FlexTable has three rows.
in the first row, after I add a SimpleLayoutPanel with setSize("100%", "360px");
and then encloses the DataGrid inside SimpeLayoutPanel, the DataGrid can shown now.
But the problem is...SimpleLayoutPanel is also implements RequiresResize, so why can I just use "100%" but not an exact "px" unit?
The TabLayoutPanel has an explicit size in unit of px, then the FlexTable has setWidth("100%"), is this the cause so I can use just % in the enclosing SimpeLayoutPanel?
Also, I see DialogBox has not implements RequiresResize and ProvideResizes, so if the outer browser windows shrink, the DialogBox will not resize accordingly, this is expected, right?

On Wed, May 30, 2012 at 2:50 PM, Thomas Broyer <t.br...@gmail.com> wrote:

ScrollPanel is also a RequiresResize, so it won't help. You have to give your DataGrid (or whatever RequiresResize+ProvidesResize parent) a size in pixels.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/PpPCjAW-Px0J.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages