:: Forum >>

Calculating number of displayable rows for a grid

I think I found a formula for this here a while ago.

Today, I just noticed that the bottom displayed row had any commas missing their lower portion.

So I modified the formula until I could see the lower portion of the row correctly. This is the code as it stands now
obj.setSize(630, 19 * ((array.length < 35 ? array.length : 35) + 1) + 2)
This allows for the display of up to 37 rows (including the grid header) on a page. But I'm still not entirely satisfied with it.

Is the height of a grid header the same as a row? If it is, I shouldn't have to add extra pixels. Could setSize be changed to take a number of rows as its height argument instead?
Anthony
Monday, September 22, 2008
The grid has 2px border, 20px header height, 18px row height. You can change row and header heights with setRowHeight/setHeaderHeight methods.
Alex (ActiveWidgets)
Tuesday, September 23, 2008
Hmm ... so I should really be doing something like -
displayable grid height = header height + (row height * number of rows to display) + footer height
Anthony
Thursday, September 25, 2008

This topic is archived.


Back to support forum

Forum search