OK, I'm after a "best practice" for this...
I have an ArrayCollection of people, which is bound to a datagrid. There is a search facility on the datagrid - a TextInput which, when changed, uses a filterFunction on the ArrayCollection to see if the Name starts with that entered string.
protected function txtSearch_changeHandler(event:Event):void
dg.dataProvider.filterFunction = nameFilter;
private function nameFilter( itm : Object ) : Boolean
return itm.Name.toLowerCase().indexOf(txtSearch.text.toLowerCase()) == 0;
However, I don't want the model.people ArrayCollection to be filtered elsewhere in my application. So, what is the best practice for doing this?
I was thinking, do I have a copy of the ArrayCollection in this component, which I then use BindingUtils.bindProperty to make sure it stays in sync with the model.people collection? Or is there a better solution?