tags:

views:

134

answers:

1

I have an ArrayCollection bound to a view, I use a filterFunction on this view to only display parts of the contents. Additionally I have another component where I want to display other parts of the ArrayCollection.

What I would like to do is wrap ArrayCollections around each other, meaning I could have one ArrayCollection containing the model data, and then two separate outer ones where I can set the filterFunction property (setting this in the model seems inappropriate in all cases). Is this possible somehow?

If not, how else can this be solved, preferably without forcing model logic to end up in my view?

+4  A: 

You'll need to create multiple ListCollectionView instances and pass in the arraycollection. Then apply the filter to the collection views instead of the arraycollection.

See http://livedocs.adobe.com/flex/3/langref/mx/collections/ListCollectionView.html for more info on ListCollectionView

Christophe Herreman
Exactly what I was looking for! Thank you. Don't know why i missed that class.
Adam Bergmark