It looks to me that the Label's width is not tied to the explicitWidth of the 
renderer at measure time, only at layout time.

You can try binding label's width to "{explicitWidth - 14}".  If you think the 
binding is too slow, then override the explicitWidth setter and set the Label's 
width then.

HTH,
-Alex

From: Marcus Fritze 
<marcus.fri...@googlemail.com<mailto:marcus.fri...@googlemail.com>>
Reply-To: "dev@flex.apache.org<mailto:dev@flex.apache.org>" 
<dev@flex.apache.org<mailto:dev@flex.apache.org>>
Date: Friday, March 14, 2014 12:31 PM
To: "dev@flex.apache.org<mailto:dev@flex.apache.org>" 
<dev@flex.apache.org<mailto:dev@flex.apache.org>>
Subject: Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....

This is my ItemRenderer code:

<?xml version="1.0" encoding="utf-8"?>
<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009";
  xmlns:s="library://ns.adobe.com/flex/spark"
  xmlns:mx="library://ns.adobe.com/flex/mx"
  focusEnabled="false">
<fx:Script>
<![CDATA[
import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;


import scripts.utils.Utils;


override public function set data(value:Object):void
{
super.data = value;


if(value != null)
{
var _listData:AdvancedDataGridListData = listData as AdvancedDataGridListData;


if(value.ist_aktuell == "ja")
this.lblData.setStyle("fontWeight", "bold");
else
this.lblData.setStyle("fontWeight", "normal");


switch(_listData.dataField)
{
case "fileNumber":
lblData.text = ""; //addedFilesToList.toString();
addedFilesToList++;
break;
case "referenz_name":
lblData.text = value[_listData.dataField];
break;
case "dokument_name":
lblData.text = value[_listData.dataField];
break;
case "file_index":
lblData.text = value[_listData.dataField];
break;
case "status":
lblData.text = value.status_code + " [" + value.version + "]";
break;
case "datum":
lblData.text = Utils.timestamp_to_time(value.ersteller_zeit_utc, "DD.MM.YY", 
false);
break;
}

}

}


]]>
</fx:Script>


<s:Label id="lblData" top="0" left="0" right="0" bottom="0" paddingTop="5" 
paddingLeft="7" paddingRight="7" paddingBottom="5" backgroundColor="0xFF0000"/>
</s:MXAdvancedDataGridItemRenderer>



Am 14.03.2014 um 20:06 schrieb Alex Harui 
<aha...@adobe.com<mailto:aha...@adobe.com>>:

What does your renderer code look like?  If the height of the Label cannot be 
completely determined from the explicitWidth of the renderer, then 
measuredHeight will not compute correctly.

Reply via email to