You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mark goldin <ma...@gmail.com> on 2015/04/02 17:40:29 UTC
Sorting ArrayCollection after filtering
I need to order an ArrayCollection after it gets filtered. I also need to
filter it in a descending order. Can I set an order beforehand and then
when ArrayCollection is filtered and refreshned the order will take a
place?
Thanks
RE: Sorting ArrayCollection after filtering
Posted by Kessler CTR Mark J <ma...@usmc.mil>.
Yes you can do both at the same time. Using the filterFunction [1] and the sort[2] properties. If it doesn't update automatically call refresh().
[1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ListCollectionView.html#filterFunction
[2] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ListCollectionView.html#sort
-Mark
-----Original Message-----
From: mark goldin [mailto:markzolotoy@gmail.com]
Sent: Thursday, April 02, 2015 1:22 PM
To: users
Subject: Re: Sorting ArrayCollection after filtering
But the question is whether I can use a single refresh to get both
filtering and ordering working.
Re: Sorting ArrayCollection after filtering
Posted by mark goldin <ma...@gmail.com>.
But the question is whether I can use a single refresh to get both
filtering and ordering working.
On Thu, Apr 2, 2015 at 12:05 PM, Deepak MS <me...@gmail.com> wrote:
> You can filter the AC first and then sort it using Sort and SortField:
>
> http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/
> On 2 Apr 2015 21:10, "mark goldin" <ma...@gmail.com> wrote:
>
> > I need to order an ArrayCollection after it gets filtered. I also need to
> > filter it in a descending order. Can I set an order beforehand and then
> > when ArrayCollection is filtered and refreshned the order will take a
> > place?
> >
> > Thanks
> >
>
Re: Sorting ArrayCollection after filtering
Posted by Deepak MS <me...@gmail.com>.
You can filter the AC first and then sort it using Sort and SortField:
http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/
On 2 Apr 2015 21:10, "mark goldin" <ma...@gmail.com> wrote:
> I need to order an ArrayCollection after it gets filtered. I also need to
> filter it in a descending order. Can I set an order beforehand and then
> when ArrayCollection is filtered and refreshned the order will take a
> place?
>
> Thanks
>