tags:

views:

60

answers:

2

I have a datagrid where one column calls a custom an itemEditor like;

                    <mx:DataGridColumn dataField="city"
                                       width="150" 
                                       headerText="City" 
                                       itemEditor="components.ComboCity" 
                                       editorDataField="city"/>

And my custom itemEditor looks like;

    <?xml version="1.0" encoding="utf-8"?>
    <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                              xmlns:s="library://ns.adobe.com/flex/spark" 
                              xmlns:mx="library://ns.adobe.com/flex/mx" 
                              focusEnabled="true">
        <mx:ComboBox id="comboBox"/>
        <fx:Script>
            <![CDATA[
                public var myString:String;
                .
                .
                .

How can I pass from my main application a value to myString ?

+1  A: 

Take a look at this link, I think you will find your answer there :

http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_3.html

Furher xp:

  myGrid.editedItemRenderer.data.City=myEditor(myGrid.itemEditorInstance).setCity.text;
c0mrade
A: 

You can always refer to parent component from itemRenderer by calling "outerDocument" property, e.g:

myString = outerDocument.componentProperty

http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_6.html

JabbyPanda