flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kessler CTR Mark J <mark.kessler....@usmc.mil>
Subject RE: Spark GridItemRenderer
Date Wed, 02 Jul 2014 11:01:08 GMT
Possibly listen for the dataChange event[1] or override the data setter[2] for the renderer.
 Handle assignment of the data yourself, checking for nulls/ bad values.


[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/gridClasses/GridItemRenderer.html#event:dataChange
[2] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/gridClasses/GridItemRenderer.html#data


-Mark

-----Original Message-----
From: Deepak MS [mailto:megharajdeepak@gmail.com]
Sent: Wednesday, July 02, 2014 2:26 AM
To: users@flex.apache.org
Subject: Spark GridItemRenderer

Hello,
I was generating columns for a datagrid dynamically, but wanted to align
number columns on right and hence I used following code to assign renderer
to the gridcolumn:

var gc:GrdiColumn = new GridColum('Growth');
var ir:ClassFactory = new ClassFactory(SpreadItemRenderer);
ir.properties = {textAlign:'right'};
gc.itemRenderer = ir;

SpreadItemRenderer.as :
public class SpreadItemRenderer extends GridItemRenderer
    {


        public var textAlign:String;
        public function SpreadFormatRenderer()
        {
            super();
        }

override protected function createChildren() : void
        {
            super.createChildren();
          if(labelDisplay)
           {
                labelDisplay.setStyle("textAlign", textAlign);
           }

        }
}


But, when I do that, column do not display any data in the datagrid. When I
debugged, I see that labelDisplay is always null. Isn't labelDisplay used
to display data under GridItemRenderer?

What am I missing here?

I am using Flex 4.12.0 | AIR 4.0 | FP 12.0 for a mobile app (iPad).
Mime
View raw message