If you have filter function like:
private function filterBySelectedIds(item : Object) : Boolean {
   if (selectedIds.contains(item.id)) {
       return true;
   } else {
       return false;
   }
}
And yourArrayCollectionToFilter.filterFunction = filterBySelectedIds;

When user selects some IDs for example, you know what user has selected
(selectedIds : ArrayCollection). This collection changes while user changes
selection and dispatches "collectionChange" (
CollectionEvent.COLLECTION_CHANGE). In handler for this event you just have
to call
yourArrayCollectionToFilter.refresh(). That seems all you have to do to
filter by id. If you need filtering by name too you have to listen to
"collectionChange" from that selectedNames : ArrayCollection and to do the
same in handler. Filter function in this case will look like:
private function filterBySelectedIds(item : Object) : Boolean {
   if (selectedIds.contains(item.id) && selectedNames.contains(item.name))
{
       return true;
   } else {
       return false;
   }
}

This is very straight-forward (read not flexible) approach. However it
should work. And flexibility may be gained via customization for the filter
function or, as I said before, write your own filtering methods.

R.

On 1/4/07, michrx7 <[EMAIL PROTECTED]> wrote:

  What I really need is to filter based on unknown criteria so if my
arraycollection contains two columns: ID, Name and there are 10 IDs (1-
10) and 10 names (pick some) the user might want to filter down to IDs
1,3,7 and then the next time IDs 2,3,8,9. Since the number of IDs is
variable there is no way to write combinations of filters based on
possible choices.

Now my actual app has more columns (with more available filters), but
if I could get this solved I could adapt for the rest.

Thanks!

Reply via email to