How to get a value of mx:DataGridColumn

By , last updated February 9, 2016
<?xml version="1.0" encoding="utf-8"?>
<mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
            import mx.controls.Label;

            public function willShowResult(result:Label, myVar:String):Boolean {
                if (myVar== 'XXX') {
                    return false;
                }
                return true;
            }
        ]]>
    </mx:Script>

    <mx:columns>
        <mx:DataGridColumn 
            dataField="myVar"
            headerText="My var"/>
        <mx:DataGridColumn 
            dataField="result"
            headerText="My result">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:Label text="{outerDocument.willShowResult(this, data.myVar) ? data.result : ' ' }"/>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
    </mx:columns>

</mx:DataGrid>

Comments

Be the first to comment.

Leave a Reply


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*