开发者

Did centering within a DataGrid column change from Flex3 to Flex4?

开发者 https://www.devze.com 2023-03-23 13:54 出处:网络
In Flex3, I could center a checkbox within a datagrid column using this: <mx:DataGridColumn textAlign=\"center\" itemRenderer=\"mx.controls.CheckBox\"/>

In Flex3, I could center a checkbox within a datagrid column using this:

<mx:DataGridColumn textAlign="center" itemRenderer="mx.controls.CheckBox"/>

That is, the centering is specified on the column. In Flex4, that doesn't work. I have to put the centering on the renderer rather than on the column.

<mx:DataGridColumn>
   <mx:i开发者_如何学编程temRenderer>
      <mx:Component>
         <mx:CheckBox textAlign="center"/>
      </mx:Component>
   </mx:itemRenderer>
</mx:DataGridColumn>

Does anyone know if this change from Flex3 to Flex4 was intentional?


You need to put the checkbox inside a canvas:

<mx:Component>
     <mx:Canvas width="100%" height="100%">
         <mx:CheckBox textAlign="center"/>
     </mx:Canvas>
 </mx:Component>
0

精彩评论

暂无评论...
验证码 换一张
取 消