Flex Grid itemRenderer

grid:

<columns:ExtendedAdvancedDataGridColumn editable="false"
	headerText="{resourceManager.getString('resources', 'STATUS')}" dataField="STATUS"
	itemRenderer="com.fisci.asia.common.renderers.StatusColunmRenderer" width="100">
</columns:ExtendedAdvancedDataGridColumn>

renderer:

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:ArrayCollection id="status">
		<mx:Object label="{resourceManager.getString('resources', 'MA')}" data="MA"/> 
		<mx:Object label="{resourceManager.getString('resources', 'OU')}" data="OU"/>
		<mx:Object label="{resourceManager.getString('resources', 'CA')}" data="CA"/>
	</mx:ArrayCollection>
	<mx:Script>
		<![CDATA[
			import com.fisci.asia.common.util.ArrayCollectionUtils;
			
			override public function set data(value:Object):void{
				if(!value){
					return;
				}
				super.data = ArrayCollectionUtils.getLabelByData(status, value.STATUS);
			}
		]]>
	</mx:Script>
	<mx:Label text="{data}" />
</mx:HBox>

 

发表评论