I think I would approach this by having an "isExpanded" property on the
dataProvider items, and toggle that property using logic in a change
handler.  The renderer would use that property to set its visual state.

 

There won't be any clear relationship between selectedItems and the visual
renderers.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of gwangdesign
Sent: Friday, March 13, 2009 6:05 PM
To: [email protected]
Subject: [flexcoders] changes on item renderers on a List

 

Hi,

I am re-sending this question since this seemingly simple question has been
taking me a bit much longer than I expected;)

I have a whole bunch of item renderers inside a List (or it lays out and
scrolls the renderers the way a List does). Here is what I am trying to do:
I'd like to expand/shrink these item renderers based on whether they are
newly "selected" or "de-selected". My approach right now is extending List
class. I listen to ListEvent.CHANGE event and invalidate my component as it
occurs. I then try to figure out which renderer has been
selected/deselected... and I can't.

Basically my component is interested in the following actions:
1. When "allowMultipleSelection" is true, user selects an item that hasn't
been selected yet;
2. When "allowMultipleSelection" is true, user selects an already selected
item;
3. When "allowMultipleSelection" is false, user selects a new item;
4. When "allowMultipleSelection" is false, user selects an already selected
item;

I poke into the code of mx.controls.ListBase and List and the code is a bit
over my head right now;)

Any ideas? pseudo code is welcome!

Thanks and have a great weekend!

-geng



Reply via email to