flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Hardiman <c...@hardiman.com>
Subject Spark GridItemRenderer not rendering
Date Thu, 16 Feb 2017 12:45:28 GMT
Hi,
I have a situation involving a Spark DataGrid using a custom Spark GridItemRenderer.
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;
			colsL.addItem(colL);


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)
				return;
			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.

Ciao
P. Hardiman


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message