I am creating a datagrid that uses a custom component in an item renderer to
display one of 3 images (symbols of an embedded swf)

 

The data grid columns are created dynamically. I can't figure out how to set
the value of imagePath inside this custom component. 

 

The symbol names are the same as the value for xmlColumn.localName();

 

Any help really appreciated!!

 

 

e.g

 

dgc = new DataGridColumn();

dgc.headerText = xmlColumn.localName();
dgc.itemRenderer=new ClassFactory(statusComponent); 
dgc.dataField = xmlColumn.localName();

 

My custom component is as follows:

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="100"
height="30">

<mx:Script>
<![CDATA[

[Bindable]
[Embed('assets/icons.swf', symbol='incomplete')]
public var incomplete:Class;

[Bindable]
[Embed('assets/icons.swf', symbol='awaitingSubmission')]
public var awaitingSubmission:Class;

[Bindable]
[Embed('assets/icons.swf', symbol='submitted')]
public var submitted:Class;

public function set imagePath(value:String):void {

statusIcon3.source=this[value]; 

}

]]>
</mx:Script>

<mx:SWFLoader id="statusIcon3" x="5" y="6"/>

</mx:Canvas> 

Reply via email to