tags:

views:

392

answers:

1

I have a group of controls and I want to organize them in a table like fashion. I want 1 row and 6 columns. Col 1,3,4,5,6 should all auto size to the contents and col 2 should take up the remaining available space. When the size of the group changes, only col2 width should change. I also want to be able to set the alignment of each cell.

How can I do this in flex 4? I found a reference to mx:constraintColumns but this seems to be used with the canvas and in flex 4 adobe suggests not using canvases. Is there something similar in flex 4?

I'm looking for something along the lines of Grid/Grid.ColumnDefinitions in silverlight.

A: 

Are you referring to arranging controls or data?

If controls, there are several spark layout tags you can use, if data, the mx:DataGrid has mx:DataGridColumn which you can specify the widths for cols 1,3,4,5 and 6 and not specify width for col2. As a result, col2 should take up the remaining space.

If not data, then controls you have a little less "control" over, but the "Learn Flex in a week" tutorials help with control layout. See "Laying out components in containers" on Day 1:

http://www.adobe.com/devnet/flex/videotraining/

Gazzos