Filter Roster by Group

Hello. I am trying to create a datagrid that displays only the members of the roster belonging to a certain group. Is there any way to filter the roster before passing it on as a dataprovider to the datagrid component? That said, is it possible to keep it in sync whenever the roster changes?



got it! dont know if it a clean and efficient solution but…:

function filterDataProvider(dp:Object,field:String,filter:String):Array{

var filteredArray:Array = new Array();

for(var i = 0; i < dp.length ; i++)


var item:Object = dp.getItemAt(i);

if(eval(“item.” + field) == filter) filteredArray.push(item);


return filteredArray;


var myRoster:Roster = new Roster(myConnection);

listener = new Object();

listener.modelChanged = function(evt){

MyGrid.dataProvider = filterDataProvider(myRoster,“group”,“Managers”);


myRoster.addEventListener(“modelChanged”, listener);

if anyone has a better solution please post it here.