2 Replies Latest reply on Apr 13, 2011 11:03 AM by saisri2k2

    Why filterFunction acts like this?

    Santanu Karar Level 1

      I'm using a filter function with my arrayCollection list as this way:

       

       

       

      // attaches filter function

      collection.filterFunction = filterCollection;

      collection.refresh();

       

       

       

      private static function filterCollection( item:Object ) : Boolean {

        return item[_searchField].match( new RegExp(_searchString, "i") );

      }

       

       

       

       

      This usually makes sense of "search any character". So what should expected to get in a search when I search something with a quoted string like: "my some string". But by adding quotes filter function returns nothing; but when I removes the quotes from that string it returns the proper result. If the said regExp makes the concept of "Search any character", then why not the result also come up even when I add quotes.

       

       

      And if possibly how should I get rid of this - getting the result even its added with quotes.