convert what toArray()? I don't know where the filterFunction results live in order to reference the object/arraycollection that stores the results.
Don --- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > toArray() > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Don Kerr > Sent: Wednesday, July 30, 2008 11:57 AM > To: [email protected] > Subject: [flexcoders] Datagrid filterfunction results > > > > I have a dataProvider feeding a dataGrid. I have a filterFunction that > filters the DP down to a subset of the dataProvider. I reference the > dataProvider , myDG.dataProvider. But, how do I reference just the > filtered down data? myDG.dataProvider gives me all data, not filtered > data. > > Having trouble finding the property where the filterFunction result > set is stored. I'm hoping it lives in an ArrayCollection somewhere > already. If not, how would I build an ArrayCollection of the results > as it filter all items? > > I want to pass just the filtered down data to another component. > > Thanks, > Don > > Below is an example of one of my filters: > > public function processFilter(item:Object):Boolean > { > var result:Boolean=false; > > //make sure there is a search term > if(term.text != null && term.text.length > 0) > { > //get the search term as upper case > var searchTerm:String = term.text.toUpperCase(); > //check against the title > if(item.crNumber != null && item.title.length > 0) > { > result = (item.crNumber.toUpperCase().indexOf(searchTerm) != -1); > } > //no need to check doc number if title already matched or if there is > no docNumber > if(result == false && item.docNumber != null && item.docNumber.length > > 0) > { > result = (item.docNumber.toUpperCase().indexOf(searchTerm) != -1); > } > if(result == false && item.title != null && item.title.length > 0) > { > result = (item.title.toUpperCase().indexOf(searchTerm) != -1); > } > } > return result; > } >

