Dataset Filtering. Advice needed. Please help!

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");
} 

Say the ‘item.empType’ contains 3 managers and 2 assisstants.Would it be possible to modify this code to look through the empType node and if it finds one manager include it… but filter out the other 2 managers and include 1 assisstant and filter out the other one.Basically what i want to create is a combobox/datagrid/listbox that lists every type of ‘empType’ ONCE.

Its for an application that im working on that requires a dynamically populated XML based menu system. I have no control over the XML file so I need it to populate this every time the application is loaded.

Anyone know if this can be achieved?? or the best way to achieve this??

I would love any help… i’m on a tight deadline for this one. Thanks for your time.