flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark goldin <markzolo...@gmail.com>
Subject Cannot get filtered dataProvider to get rid of an item
Date Wed, 01 Jun 2016 18:51:47 GMT
Here is some code:
override public function set dataProvider(value:Object):void
{
if (value)
{
visible = false;
super.dataProvider = value;
if (!(dataProvider is HierarchicalData) )
{
dataProvider.addEventListener('collectionChange', positionToPrevSelection);
}
visible = true;
}
else
{
super.dataProvider = null;
validateNow();
}
}
private function positionToPrevSelection(event:CollectionEvent=null):void
{
       for (var i:int=0;i<dataProvider.length;i++)
{
if (dataProvider[i].name == 'ROOT')
{
dataProvider.removeEventListener('collectionChange',
positionToPrevSelection);
dataProvider.filterFunction = filterOutRoot;
dataProvider.refresh();
break;
}
}
}
private function filterOutRoot(item:Object):Boolean
{
if (item.name == 'ROOT')
{
return false;
}
return true;
};
I see that the line item.name == 'ROOT' is true for one item.
But the grid still shows ROOT.

Any idea how to fix it?

Thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message