I have following itemrenderer
<?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="true">
<s:Label id="lblData" top="0" left="0" right="0" bottom="0" text="{listData.label}" />
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
override public function set data(value:Object):void
{
if(value != null)
{
super.data = value;
if(value.age >30 )
lblData.setStyle("backgroundColor","red");
else
lblData.setStyle("backgroundColor","green");
}
//super.invalidateDisplayList();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth,unscaledHeight);
if(super.data)
{
}
}
]]>
</fx:Script>
</s:MXAdvancedDataGridItemRenderer>
My question is Should above logic go in updtaeDisplayList or remain in set data() itself.
The output is smae from both. Whats the performance impact difference if we consider it from lifecycle perspective.(The heavy computations should be pushed towards the end of the frame rendering)
In your way I’d rather use
invalidateProperties()andcommintProperties(). But what about using data binding?