How to implement Expandable-Collapsible Rows in CellTable ?

1,261 views
Skip to first unread message

zixzigma

unread,
Feb 3, 2011, 10:33:41 PM2/3/11
to google-we...@googlegroups.com
Hello Everyone,
Could you please provide some tips on how to implement Collapsible Rows in CellTable ?

for example, clicking on a Row, result in Row to be expanded, and display some custom widget in it.

so far, I was able to put a custom widget (label, button, text box) within the cell,
this works fine. I then wanted to show/hide this widget, as user clicked on the cell.

my custom cell handles click event, and adds/removes css style (display:none), as a result I can show/hide my custom widget,
but the problem is, since I am handling click event, when the user wants to do
something meaningful with the widget inside the row, the row is closed,
(for example entering something inside the textbox, causes the row to close (hide/collapse))
I used event.preventDefault(), to stop the click event from firing once the row is expanded (preventing it from hiding, so that user can enter text into textbox),
but cannot reverse it (remove it so that it can be closed).

 anyways I tried many many unconventional solutions, including putting a basic Tree and StackPanel inside a Custom Cell !
none of them worked  : (

I know that I am not doing things the right way,
do you have any tips on how to implement this feature ? Expandable/Collapsible Rows inside a CellTable ?

do you think this feature will be added in later releases of GWT ?

Thank You

Thomas Broyer

unread,
Feb 4, 2011, 3:47:30 PM2/4/11
to google-we...@googlegroups.com

On Friday, February 4, 2011 4:33:41 AM UTC+1, zixzigma wrote:
I know that I am not doing things the right way,
do you have any tips on how to implement this feature ? Expandable/Collapsible Rows inside a CellTable ?

I would try doing it without widgets, with a CellList instead of a CellTable (so that 1 row == 1 "cell", and the "second row" is just the cell that expands; very useful I guess when you want "col span"), witha CompositeCell (and using an inner table if possible, or just styling, to align "columns").

do you think this feature will be added in later releases of GWT ?

Yes, it will. 

Jimmy Abraham

unread,
Aug 4, 2013, 2:13:38 PM8/4/13
to google-we...@googlegroups.com
Hi all,
please help me implement Collapsible Rows in CellTable.../is it already available in gwt?
thanks in advance 
jimmy

Thomas Broyer

unread,
Aug 4, 2013, 6:58:02 PM8/4/13
to google-we...@googlegroups.com
Have a look at http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCustomDataGrid
Spoiler alert: not straightforward.

Larry L

unread,
May 7, 2015, 5:27:00 PM5/7/15
to google-we...@googlegroups.com
Hi,

I have a follow up question about this CustomDataGrid example.
My DataGrid is enabled for selection. So I can select/highlight the major rows.
But how do I get the selected minor-rows? 

for example, my code is like this:
SelectionModel<? super Object> model = dataGrid.getSelectionModel();
But the minor rows are not in my SelectionModel.

Thanks,
Larry
Reply all
Reply to author
Forward
0 new messages