Flex - vertically aligning cells in a Datagrid
5 answers
try use <s:HorizontalLayout verticalAlign="middle">:
<s:GridColumn headerText="Action" >
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<s:layout>
<s:HorizontalLayout verticalAlign="middle" paddingLeft="5"/>
</s:layout>
<s:Button label="View" click="outerDocument.view(event)" />
<s:Button label="Unlink" click="outerDocument.unlink(event)" />
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
+2
source to share
The mx: Text and TextField controls do not directly support the verticalAlign style.
The easiest way would be to align the contents of your container eg. container.setStyle("verticalAlign", "bottom")
or so.
If the container is using an absolute layout, you can set one of the top, bottom, left and right styles to 0
to align appropriately.
+1
source to share
Use the VerticalAlign DataGrid property (set to "medium")
verticalAlign: render vertical alignment in line
http://www.adobe.com/livedocs/flex/2/langref/mx/controls/DataGrid.html#styleSummary
+1
source to share