View Full Version : Grid Row Height

18 Aug 2009, 4:01 AM

I am trying to setup a grid wich has no fixed row height.

I have found a way to do this, but I am not sure that my approach is supported or what side effects it may have.

So my main question is: Is there any supported way to have a grid which has no fixed row height?

Here is my current approach:
I have created two css style classes:
.custom-no-row-height {
line-height: ;
.custom-col-wrap-lines {
white-space: normal;
The custom-no-row-height class is set via a custom GridViewConfig.
The custom-col-wrap-lines style is needed to enable text wrap so my cells can have multiple text rows. To enable it I have created a custom GridView that overrides the doReneder Method and applies the style to the div which surrounds each cell. Since I had to copie the original code o fthe onRender Method to achieve this, this seems to be a very bad approach to me, but at least it works. Any better approach to this would be appreciated.

Besides the fact that I do not know what side effects I may see in the future and that any future gxt release may break my soloution, I have two concrete problems with my soloution:

The table height is greater than specified (this may also be a problem with a bad surrounding layout).
I have tried to get this working with a TreeGrid, but it didn't work.

19 Aug 2009, 4:54 AM
maybe this helps?


adding a stylename to the grid let enable you this style only for this grid.
you dont need a custom onRender etc.

19 Aug 2009, 6:18 AM
Thank, You,

this looks good, I will try it.

I have found a soloution for the TreeGrid problem.
Turning off the buffering works:
lTreeGrid.getTreeView().setBufferEnabled( false );

lTreeGrid.getTreeView().setBufferEnabled( false );