[flexcoders] getItemIndex on filtered List

2009-04-25 Thread evan_mcd
Hi all,

I'm having some issues when calling getItemIndex on an ArrayCollection with a 
filterFunction set.

I do something like myAC.removeItemAt(myAC.getItemIndex(myObject)), which works 
fine when the filtering hasn't been applied.  As soon as filtering is applied, 
getItemIndex seems to return -1 in every case.  

Has anyone come across this before?  What the best way to remove an item form a 
filtered ArrayCollection?

Thanks a lot.

- Evan



RE: [flexcoders] getItemIndex on filtered List

2009-04-25 Thread Alex Harui
getItemIndex should not be returning -1 when filtered unless myObject is 
excluded by the filter function.  I'd write a test that scans the filtered 
collection and compares it to myObject.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of evan_mcd
Sent: Friday, April 24, 2009 8:08 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] getItemIndex on filtered List





Hi all,

I'm having some issues when calling getItemIndex on an ArrayCollection with a 
filterFunction set.

I do something like myAC.removeItemAt(myAC.getItemIndex(myObject)), which works 
fine when the filtering hasn't been applied. As soon as filtering is applied, 
getItemIndex seems to return -1 in every case.

Has anyone come across this before? What the best way to remove an item form a 
filtered ArrayCollection?

Thanks a lot.

- Evan