That depends on what your item render is supposed to do when the value of
the isVisible property changes.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

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

 

  

Tracy, I always make visual changes in commitProperties and/or
updateDisplayList - me and the component life cycle are good buddies :)

In this case with the iterator, I'm still figuring out how items get
refreshed and whether there are high-level functions that take care of
making visual changes at the appropriate times. Judging by your comment
though it seems not :)

So if I have an ArrayCollection of USER objects and for USER #3 I change the
IsVisible property to false and set some boolean flag that its dirty,
how/what do I refresh in commitProperties to reflect that specific change
for that specific USER object?

 



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

  

Why would you not use commitProperties()?  Where else would you do the work?
Do not do it in set data().  Do you understand why?

 

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 5:10 PM


To: flexcod...@yahoogro <mailto:flexcoders@yahoogroups.com> ups.com
Subject: Re: [flexcoders] ItemRender - Access Specific Item at Run-time

 

  

@Jake, I am implementing search-as-you-type, so there's a separate input box
outside of the itemrender that needs to show/hide items that match or don't
match what was typed in. I am using the *change* event of the search box.

@Tracy, thanks for the suggestion, I tried that originally and it worked,
but the experience was lacking because all items would disappear then
re-appear on every key press. I would like for only the specific items
affected to fade-out or fade-in when required.

So far it seems adding an IsVisible property will work. When the input box
*changes* I update the collection then invalidate the container's properties
(or refresh the collection?). Depending on how that works out, I may or may
not need to add commitProperties logic.

Baz




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

  

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: 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 4:21 PM
To: flexcod...@yahoogro <mailto:flexcoders@yahoogroups.com> ups.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