I have a situation involving a Spark DataGrid using a custom Spark 
It’s all in ActionScript use Spark components.

The invocation:
                        colL = new GridColumn();
                        colL.headerText = "Calorie";
                        colL.dataField = "calorie";
                        renderL = new ClassFactory(PrecisionFormater);
                        colL.itemRenderer = renderL;
                        propL = new Object();
                        propL.fldName = "calorie";
                        propL.precision = 3;
                        renderL.properties = propL;

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

                override public function set data(valueA:Object):void
                        if(null == valueA)
                        var labelL:Label = new Label();
                        var numL:Number = Number(valueA[fldName]);
                        var bufL:String = String(numL.toFixed(precision));
                        super.data = bufL;
                        labelL.text = bufL;
                        super.labelDisplay = labelL;
When I step through the code, bufL looks like I would expect. However, the grid 
renders blanks in the column.
I just recently added the Label, but no joy.

Appreciate any assist.

P. Hardiman

Reply via email to