Well, I didn't intend that you use the code exactly as I typed it. I just
wanted to give you an idea of how I would write that function.

It's a while since I wrote a filter function so I'll leave it to someone
else to correct my code.

On Wed, Mar 12, 2008 at 8:56 AM, JRBower <[EMAIL PROTECTED]> wrote:

>
> I gave it a try but all rows disappear.
>
> I also tried
> var result:Boolean=true;
>
> and
>
> var result:Boolean=false;
>
> The text input also has a change event if this is relevant:
>
> <mx:TextInput id="userIDFilter"
> change="this.masterList.dataProvider.refresh()" />
>
> Any other ideas?
>
> Giles Roadnight wrote:
> >
> > I'd do it somethign like this:
> >
> > // Datagrid Filter
> > public function processFilter(item:Object):Boolean
> > {
> >
> > var result:Boolean=true;
> > var pattern:RegExp = new RegExp("^"+userIDFilter.text,"i");
> >
> > if(item.UserID != null && !item.UserID.match(pattern))return false;
> >
> > if(item.FirstName != null && !item.FirstName.match(pattern))return
> false;
> >
> > ect
> >
> > return true;
> > }
> > That what you are looking for?
> >
> > --
> > Giles Roadnight
> > http://giles.roadnight.name
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Filter-function-%22Sort%22-of-working-tp15999711p16000140.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
>  
>



-- 
Giles Roadnight
http://giles.roadnight.name

Reply via email to