Just changing Label to Text worked. I didn't have to write a measure 
method.

I really wish the Flex controls had been written in a way that 
matches the OS's behavior better. I've had to write a lot of code 
(for example, this tooltip fix), just to make standard controls.

Ah well. Better the way it is, than not existing at all.



--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Wordwrapping is the responsibility of the renderer.  Label is a
> single-line control so it won't word wrap.  Using Text is possible 
but
> you have to wire up the measure method correctly.  See past threads 
for
> how to do that.  Also, that makes a heavy weight renderer.
> 
>  
> 
> My recommendation is to copy DataGridItemRenderer and remove the 
datatip
> code.
> 
>  
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of whatabrain
> Sent: Tuesday, August 12, 2008 3:55 PM
> To: [email protected]
> Subject: [flexcoders] My itemRenderer is cancelling wordWrap 
setting on
> AdvancedDataGridColumn
> 
>  
> 
> I want an AdvancedDataGridColumn to have word wrap, soI set the 
> wordWrap attribute to true. The column contains an itemRenderer, 
which 
> renders an mx:Label, which contains the actual text. But that text 
> doesn't wrap.
> 
> <mx:AdvancedDataGridColumn wordWrap="true">
> <mx:itemRenderer>
> <mx:Component>
> <mx:Label text="I am an unhappy table cell"/>
> </mx:Component>
> </mx:itemRenderer>
> </mx:AdvancedDataGridColumn>
> 
> The reason I'm using an itemRenderer is because otherwise, tooltips 
> don't work properly. They are always drawn within the cell, instead 
of 
> appearing at the corner of the mouse cursor like they should. 
Putting 
> the tooltip on the Label fixes the problem.
>


Reply via email to