User Guide

DataSet.filtered 359
DataSet.filtered
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSetInstance.filtered
Description
Property; a Boolean value that indicates whether the data in the current iterator is filtered.
The default value is
false.When this property is true, the filter function specified by
DataSet.filterFunc is called for each item in the collection.
Example
In the following example, filtering is enabled on the DataSet object named employee_ds.
Suppose that each record in the DataSet collection contains a field named
empType. The
following filter function returns
true if the empType field in the current item is set to
"management"; otherwise, it returns false.
employee_ds.filtered = true;
employee_ds.filterFunc = function (item:Object) {
// Filter out employees who are managers.
return(item.empType != "management");
};
The following example populates a DataGrid component from content dynamically loaded
using the XMLConnector component. When a user clicks a CheckBox instance on the Stage,
the contents of the DataSet component are filtered and are updated automatically in the
DataGrid component.
Drag the following components to the Stage, and give them the following instance names:
CheckBox (editorsChoice_ch)
DataGrid (reviews_dg)
DataSet (reviews_ds)
XMLConnector (reviews_xmlconn)