This content has been marked as final. Show 2 replies
"AlanSean" <firstname.lastname@example.org> wrote in message
> We are developing a touch screen application using flex.
> We would like the datagrids, which can vary in height on each component
> (or if
> the screen is resized) to have a rowheight that is at least aa pixels
> high, but
> also that there is maximal use of the space available for the rows, so
> isn't a part row at the bottom.
> e.g. at least 50 pixels high, datagrid is 380 pixels. We can get 7 full
> at 50, but that would leave 30pixels for the last row, not big enough to
> so I make 7 rows at 54 pixels, leaving 2 pixels which I make unselectable,
> unhighlightable. An odd 2 pixels at the bottom is better than an odd 30.
> First attempt, override the calculateRowHeight and return the height
> here -
> perfect, if there is data in the grid, until there is data, the row height
> the default. While this isn't a major issue because there is nothing to
> see or
> select, the problem is that when it is populated, the rows resize and it
> odd, the same if the grid is resized, the row heights are not
> Second attempt, override updateDisplayList then call the super classes'
> updateDisplayList, and set the row height in here - perfect, if the grid
> has a
> fixed height.
> Now I have a problem, if the grid is used in canvases, and height is
> based on other control positions, the header height is calculated in the
> UpdateDisplayList further up the chain of the classes which DataGrid
> from. Without the headerheight, I can't calculate the best row size,
> because I
> dont know what space is available.
> (Interestingly for some reason, if there is no data in the grid, the
> headerHeight inherits the row height initially, this is tagged in the
> class as
> to prevent bad behaviour from PDG?? This caused me an interesting problem
> the grid continually invalidating its self because I was setting differing
> rowheights each time because the header height differed)
> Am I missing a much easier way of achieving this? I am thinking of just
> setting an explicit header height and leave my code as is, but it would be
> preferable to make it all configurable/dynamic and still work.
You might want to look at minheight. That won't help with having "partial"
rows, but it will prevent it from going below that minimum. When the
datagrid is resized, you may find that call validateNow() will make the rows
I had partial rows and resolved my issue with help tool and hovering the mouse...
not sure how that is going to work with touch screen...
you may look funny hovering your finger :?)