You guys rock!

Here is the new and WORKING GridItemRenderer with the Label object formally 
added:

public class PrecisionFormater extends GridItemRenderer
{
        public var fldName:String;
        public var precision:uint;

        private var labelM:Label = new Label();

        override public function set data(valueA:Object):void
        {
                if(null == valueA)
                        return;
                var numL:Number = Number(valueA[fldName]);
                var bufL:String = String(numL.toFixed(precision));
                labelM.text = bufL;
        }

        override protected function createChildren():void
        {
                super.createChildren();
                super.addElement(labelM);
        }

        public function PrecisionFormater()
        {
                super();
        }
}

Very happy with the results.

Ciao
P. Hardiman

> On Feb 16, 2017, at 8:15 AM, Kyle McKnight <[email protected]> wrote:
> 
> I believe you should technically override createChildren of UIComponent and
> create any children in there.
> 
> http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/UIComponent.html#createChildren()
> 
> 
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 (M)
> 
> On Thu, Feb 16, 2017 at 8:03 AM, OK <[email protected]> wrote:
> 
>> 
>>> I just recently added the Label, but no joy.
>> You probably have to add your label to the display list by using:
>> 
>> this.addElement(labelL);
>> 
>> Maybe you should do the creation of elements rather in the constructor of
>> the ItemRenderer instead of doing this in the setData() method.
>> 
>> HTH,
>> Olaf
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-flex-users.
>> 2333346.n4.nabble.com/Spark-GridItemRenderer-not-
>> rendering-tp14689p14690.html
>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>> 

Reply via email to