I don't have a tested code sample to offer, but you would use the fact
that your DataGrid's dataProvider has probably been turned into an
ArrayCollection, which has a filterFunction property. You set the
filterFunction to be a reference to a method that takes a single data
item as an argument and returns true or false to indicate whether the
item should be displayed.
For example, suppose the items in your dataProvider were Address
instances and you wanted to show only the ones for a particular state
selected in a stateComboBox. Then you'd write code like
private function myFilterFunction(item:Object):Boolean
{
return Address(item).state == stateComboBox.selectedLabel;
}
and somewhere set
myDataGrid.dataProvider.filterFunction = myFilterFunction;
To get the DataGrid to refresh when you select a different state, I
think you would call myDataGrid.invalidateList() in a hanlder for the
ComboBox's "change" event.
Gordon Smith
Adobe Flex SDK Team
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of stinasius
Sent: Friday, August 08, 2008 12:14 AM
To: [email protected]
Subject: [flexcoders] Re: filtering a flex datagrid using a slider with
two thumbs
hi guys i hope am not being a pain, but how can i use a combo box and
a slider (two thumbed) to fliter a datagrid? a small code sample will
do it. thanks.