[flexcoders] Re: Datagrid filterfunction results

2008-07-31 Thread Don Kerr
Thanks! Glad it is that simple! I'll give it a try.

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> dataProvider.filterFunction = someFilteringFunction
> 
> dataProvider.refresh()
> 
> var filteredResults:Array =dataProvider.toArray()
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Don Kerr
> Sent: Wednesday, July 30, 2008 6:20 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Datagrid filterfunction results
> 
>  
> 
> 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 flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui"  wrote:
> >
> > toArray()
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of Don Kerr
> > Sent: Wednesday, July 30, 2008 11:57 AM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > 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;
> > }
> >
>




RE: [flexcoders] Re: Datagrid filterfunction results

2008-07-30 Thread Alex Harui
dataProvider.filterFunction = someFilteringFunction

dataProvider.refresh()

var filteredResults:Array =dataProvider.toArray()

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Don Kerr
Sent: Wednesday, July 30, 2008 6:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Datagrid filterfunction results

 

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 flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> toArray()
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Don Kerr
> Sent: Wednesday, July 30, 2008 11:57 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> 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;
> }
>

 



[flexcoders] Re: Datagrid filterfunction results

2008-07-30 Thread Don Kerr
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 flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> toArray()
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Don Kerr
> Sent: Wednesday, July 30, 2008 11:57 AM
> To: flexcoders@yahoogroups.com
> 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;
> }
>