PDA

View Full Version : How to set the weight of a ListField so that it displays exactly 3 rows?



amatos
14 May 2009, 1:13 AM
I would like to set the height of my ListFields so that they display exactly 3 rows at a time (the default seems to be 5). For the life of me, I couldn't find any method that allows me to set the height as a multiple of row size, only as absolute pixel sizes... Does anyone knows a way for accomplishing this? Thanks in advance,

Artur

Creakhead
22 Jun 2009, 3:47 PM
I ran into something like this too. I noticed that gxt sets the default height = 100 = 5 rows, so that's 20 per row so you can make a method like

public void setDisplayRows( int size )
{
listbox.setHeight( size * 20 );
}