User Guide

DataSet.filterFunc 361
Select Control > Test Movie. By default, the DataGrid component should display each of the
reviews from the external XML document. Clicking on the Editor’s Choice CheckBox
component causes the DataSet component to be filtered, so that only the specific reviews
flagged as an editors choice appear.
See also
DataSet.filterFunc
DataSet.filterFunc
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSetInstance.filterFunc = function (item:Object):Boolean {
// return true|false;
};
Description
Property; specifies a function that determines which items are included in the current view of
the collection. When
DataSet.filtered is set to true, the function assigned to this property
is called for each record (transfer object) in the collection. For each item that is passed to the
function, it should return
true if the item should be included in the current view, or false if
the item should not be included in the current view.
When changing the filter function on a data set, you must set the
filtered property to
false and then true again in order for the proper modelChanged event to be generated.
Changing the
filterFunc property wont generate the event.
Also, if a filter is already in place when the data loads in (
modelChanged or updateAll), the
filter isnt applied until
filtered is set to false and then back to true again.