Perhaps you should look into using "updateDisplayList()" funtion to do
the resizing instead of set data()?  I am not good enough with item
renderers to know for sure, or why, but I get the feeling that this is
the method to use for some visual manipulations.  There has been some
discussion, search the archives.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jim Robson
Sent: Tuesday, January 02, 2007 7:33 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Resize children of a Tile container: Solved (sort
of) but questions remain...

 

It took a while, but I finally discovered the cause of the problem: 
the set data() function for each renderer in the DataGrid is called
every time one of the renderers is resized. Does anyone know why set
data() is called? Here is more detail:

1) I extended the Tile container to use it as an item renderer inside
a DataGrid
2) I overrode the set data() function of the Tile in order to add the
correct number of children to the Tile based on the data (my thanks to
a member of the Flex team at Adobe for this tip). 
3) While adding the children, the size of the children is set based on
the number of children.
4) I wrote code to dynamically resize the children based on user
input. This obviously requires that the Tile be resized in order to
display the children properly. But when the Tile is resized, the set
data() function is called for every item renderer in the DataGrid,
which in turn causes the children to be reset to their default size
because of #2 above. 

If you're interested, you can access sample code at the URI referenced
in the original message below.

If anyone can shed some light on this, I would really appreciate it!

-Jim

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Jim Robson" <[EMAIL PROTECTED]> wrote:
>
> How do you dynamically resize the children in a Tile container? I
> don't have any problem setting the size when the children are
> initially added to the Tile. After that, however, they won't resize. 
> 
> I've posted a simple app that illustrates this issue (right-click to
> view source): 
>
http://robsondesign.com/flexcoders/TileRendererSample/TileRendererSample
.html
<http://robsondesign.com/flexcoders/TileRendererSample/TileRendererSampl
e.html> 
> 
> To use demo: Click on a dot to bring up a slider. As you can see in
> the source code, and verified in the trace statements, changing the
> slider changes the width and height of the dots in the selected item
> renderer. However, the display does not change, even though the width
> and height properties do change. 
> 
> If there's something in the docs about this, or if there's been a
> previous thread on this topic, please forgive me and point me to it. I
> wasn't able to find anything, but maybe I was using the wrong search
> terms. 
> 
> Thanks
> 
> -Jim
>

 

Reply via email to