I have a List component with a custom item renderer. The List is set
to variableRowHeight=true.

In the renderer is a regular TextArea component that I want to grow in
size vertically for the longer data strings.

My problem is I don't quite understand how to automate the process of
sizing the TextArea and then the renderer height from the
TextArea.textHeight property.

I can successfully do it manually, attaching a click event to the
TextArea, that calls the following function in the renderer:

private function updateHeight(ev:MouseEvent):void {
 ev.target.height = ev.target.textHeight + 5;
 this.height = ev.target.y + ev.target.height + 25;
}

This perfectly sizes each item when I click on them. 

The problem is I can't get it to function properly when I try to size
them from an event representing the item's creation. I have tried
sizing on the following events:

1) renderer creationComplete and added events
2) in the data setter override function for the renderer

No matter what I try to do, automated sizing produces incorrect
results. I am sure I just don't understand - not the first time!!!

Thanks for any help!!!
Phil

Reply via email to