You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Gregory Tyler <gr...@hotmail.com> on 2014/05/08 19:06:14 UTC

Flex 3.6 - Keeping Rows of Four Side-By-Side Grids Vertically Aligned

I am maintaining a Flex 3.6 web application. One screen has four DataGrid objects (not AdvancedDataGrid objects) that are arranged side-by-side in an HBox. The rows of all four DataGrids are vertically aligned (purely by styling) with each other. In other words, row i of each DataGrid has the same vertical position and height across all four DataGrids.

 

I have been asked to incorporate variableRowHeight in the leftmost DataGrid, so that the grid's Text controls can word-wrap when they contain long text. This was simple enough to implement -- but now when a row's height changes, the leftmost DataGrid's rows are no longer aligned with the rows of the other three DataGrids.

 

I would like the other three DataGrids' row heights to "inherit" the heights of the leftmost DataGrid's now variable-height rows. How might I do this without re-engineering the entire page? The display logic and event-handling logic is complicated.

 

Thanks in advance!
 		 	   		  

RE: Flex 3.6 - Keeping Rows of Four Side-By-Side Grids Vertically Aligned

Posted by Alex Harui <ah...@adobe.com>.
Fundamentally, you have to share something between grids.  If you can, store an extra field in the data provider with the desired height of the row.  If you can't do that, you could build a separate shared data provider of heights.

Another trick which might have performance issues, is to hide a multi-line text component in each child's custom renderer.  Then you won't see it, but it should compute to the same size.

-Alex
________________________________________
From: ActionScript Man [greg_tyler@hotmail.com]
Sent: Thursday, May 15, 2014 11:44 AM
To: users@flex.apache.org
Subject: Re: Flex 3.6 - Keeping Rows of Four Side-By-Side Grids Vertically Aligned

Thank you for the suggestion. I have been thinking along those lines, but I'm
unclear about how a custom item renderer in the three "child" grids can
know, for a specific row, the height of the same row in the "parent" grid.

If row 1 of the "parent" grid has a height of 35 pixels, and row 2 has a
height of 57 pixels, then how would the custom item renderer in a "child"
grid obtain each of these values when appropriate from the "parent" grid?

Thanks again!

Greg



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Re-Flex-3-6-Keeping-Rows-of-Four-Side-By-Side-Grids-Vertically-Aligned-tp6423p6434.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 3.6 - Keeping Rows of Four Side-By-Side Grids Vertically Aligned

Posted by ActionScript Man <gr...@hotmail.com>.
Thank you for the suggestion. I have been thinking along those lines, but I'm
unclear about how a custom item renderer in the three "child" grids can
know, for a specific row, the height of the same row in the "parent" grid.

If row 1 of the "parent" grid has a height of 35 pixels, and row 2 has a
height of 57 pixels, then how would the custom item renderer in a "child"
grid obtain each of these values when appropriate from the "parent" grid?

Thanks again!

Greg



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Re-Flex-3-6-Keeping-Rows-of-Four-Side-By-Side-Grids-Vertically-Aligned-tp6423p6434.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 3.6 - Keeping Rows of Four Side-By-Side Grids Vertically Aligned

Posted by Alex Harui <ah...@adobe.com>.
I would use custom item renderers in the other three grids that set height
based on the height computed in the fourth grid.

HTH,
-Alex

On 5/8/14 10:06 AM, "Gregory Tyler" <gr...@hotmail.com> wrote:

>I am maintaining a Flex 3.6 web application. One screen has four DataGrid
>objects (not AdvancedDataGrid objects) that are arranged side-by-side in
>an HBox. The rows of all four DataGrids are vertically aligned (purely by
>styling) with each other. In other words, row i of each DataGrid has the
>same vertical position and height across all four DataGrids.
>
> 
>
>I have been asked to incorporate variableRowHeight in the leftmost
>DataGrid, so that the grid's Text controls can word-wrap when they
>contain long text. This was simple enough to implement -- but now when a
>row's height changes, the leftmost DataGrid's rows are no longer aligned
>with the rows of the other three DataGrids.
>
> 
>
>I would like the other three DataGrids' row heights to "inherit" the
>heights of the leftmost DataGrid's now variable-height rows. How might I
>do this without re-engineering the entire page? The display logic and
>event-handling logic is complicated.
>
> 
>
>Thanks in advance!
>