It looks like the  textData is supposed to cover the full width of the renderer 
so I’m not sure why you need a custom renderer at all given the default one 
handles multi-line just fine.

However, in principle, a custom renderer should always factor explicitWidth in 
the measure() calculations.  This is especially important for word-wrapping 
text because the text’s height depends on its width.   In your case it might 
look something like this:

override protected function measure():void
{
textData.width = explicitWidth;
textData.validateClient(true);

super.measure();

// probably not needed if textData and its container will now compute the right 
height.
//measuredHeight =
textData.textHeight+2+2;//getExplicitOrMeasuredHeight has some problem

}


Then your updateDisplayList should simply layout within the given dimensions.


On 6/10/10 7:21 AM, "DevSachin" <[email protected]> wrote:







I have some problem if i do
textData.setActualSize(w,textData.textHeight+2+2); into measure function
then row height is not working proper. I am using master-Detail grid(double
grid)  concept and using custom renderer on inner grid.

DevSachin wrote:
>
> Hi Alex,
> Thanks alot for quick reply.
> I know we can not stop recycling. My question was how to solve row height
> issue that is cause by recycling renderer?
>
> Now i have changed the measure() function as you said and didnot faced row
> height recycling issue yet. I am still testing it,
> Query :please let me know if i need to do any more changes to increase
> performance:
> override protected function measure():void
>      {
>         super.measure();
>         width = this.getExplicitOrMeasuredWidth();
>         measuredHeight = textData.getExplicitOrMeasuredHeight();//
> textData.textHeight+2+2;
>
>      }
>
>
>
>

--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to