To show/hide items, use a filter on the collection.  It does not actually
remove any items.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Baz
Sent: Wednesday, August 12, 2009 4:21 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ItemRender - Access Specific Item at Run-time

 

  

Thank you very much Tracy.

What do you suggest to show/hide specific items based on an outside event? I
am hesitant to *remove* the item from the ArrayCollection as I have to add
it back at some point, maintaining the same complicated sort order.
Currently my ArrayCollection contains a list of custom objects, would you
suggest I had a property to those objects called *isHidden*, or something
along those lines, and use that to set the state to "hidden"?

Thanks a lot.

 

On Wed, Aug 12, 2009 at 1:14 PM, Tracy Spratt <tr...@nts3rd.
<mailto:tr...@nts3rd.com> com> wrote:

  

"access to the components that get created from the ArrayCollection. Is
there a way?" Short answer, no.

 

Longer answer:  itemRenderers are recycled and only the visible renderers
even exist.  When using item renderers, any state that depends on the
item/row must be driven by the item.  You need to set up your renderer so
that when an underlying item property changes, that change causes the
rendered component's state to change.

 

You do this by overriding the set data() function and commitProperties
function.

 

Find an example of an itemRenderer and modify it rather than trying to do
this from scratch.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcod...@yahoogro <mailto:flexcoders@yahoogroups.com> ups.com
[mailto:flexcod...@yahoogro <mailto:flexcoders@yahoogroups.com> ups.com] On
Behalf Of Baz
Sent: Wednesday, August 12, 2009 3:57 PM
To: flexcod...@yahoogro <mailto:flexcoders@yahoogroups.com> ups.com
Subject: [flexcoders] ItemRender - Access Specific Item at Run-time

 

  

I have a custom ItemRender that uses an ArrayCollection dataProvider.
Everything loads up and displays nicely, but I am having a heck of a time
finding out how to get at a specifc item in the list to change its state -
something like myDataContainer.ItemArray[10].state = "my_custom_state" to
get at the 10th item. Bear in mind its not the source ArrayCollection that I
need to get at, that's no problem, its access to the components that get
created from the ArrayCollection that I'm looking for. Is there a way?

Thanks very much.

 

 



Reply via email to