Hi,

I can't seem to get an itemRenderer to work properly with my DataGrid.
 I am trying to access the listData object to do some conditionals in
my renderer (eg. show a specific image based on row data).  However,
my listData property is not getting set properly.  Here's the renderer:

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"; 
         implements="mx.controls.listClasses.IDropInListItemRenderer"
         width="100%"
         horizontalAlign="center" verticalAlign="middle"
         preinitialize="initComponent();">

        <mx:Image id="theImage" width="13" height="13"/>
        
        <mx:Script>
        <![CDATA[
        import mx.controls.dataGridClasses.DataGridListData;
        import mx.controls.listClasses.BaseListData;

                                                                
[Embed(source="/assets/images/arrow_down.png")]
                    [Bindable]
                    public var downArrow:Class;

                                
                                [Bindable]
                                private var tmpSource:Class;

                                private function initComponent():void
                                {
                                        addEventListener("dataChange", 
handleDataChanged);
                                }

                                public function 
handleDataChanged(event:Event):void 
                                {   
                                        trace("listData = " + 
DataGridListData(listData));
                                        theImage.source = downArrow;
                                }   
                                
                                //Importing interface IDropInListItemRenderer 
requirements
                                private var _listData:BaseListData;
                            public function get listData():BaseListData
                            {
                              return _listData;
                            }
                            public function set 
listData(value:BaseListData):void
                                {
                                        _listData = value;
                                        dispatchEvent(new 
FlexEvent(FlexEvent.DATA_CHANGE));
                                }
                        ]]>
                </mx:Script>
        
</mx:HBox>



I'm just calling this as itemRenderer="custom.display.MyItemRenderer"
from a datagrid column...

Any help is appreciated.

Thanks,

Brendan







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Home is just a click away.  Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to