I got this to work
var pattern2:RegExp = new RegExp(text1.text, "i");\
searchResult = item.(pattern2.test( fname ) || pattern2.test(lname) );
But have another problem, the regex matches any charater and not the first chars as i type them for example
IF i have
and if i type 'c' in the textnpt i get both John Macey and Tracy Jordon.
Will dig further,
I triedthe following syntax but that does not work. It yields no result on the grid
var pattern1:RegExp = /^text1.text/;
searchResult = item.(fname.matches( pattern1 ) || lname.matches(pattern1) );
Never mind, i got this to work.
Retrieved the node;s text and used the indexOf(tex1.text) !=-1 comparison to check the match,
It works now
I created a custom text input control for filtering a datagrid easily. It's got the source available, so check it out, it'll probably do just what you want.
Essentially, it just uses the text in the input for the filter function and triggers a refresh to the dataprovider on the text input change event.