View Full Version : Ext.data.SimpleStore.filter how to use the RegExp

8 Feb 2010, 8:43 AM
Hi all,
I have doubt when filtering a combo box (Ext.form.ComboBox)
I want to filter by the text if is Airport or if is not Airport in the end of the text.
My SimpleStore have values of the "text" field like 'Barcelona International Airport' and I want an RegExp to get the text when have Airport inside or when it doesn't have.
I use:

//the var of my SimpleStore is 'g'. This would be to filter to not show text that have 'Airport' in the end of the Character.
g.filter("text", new RegExp("/^Airport$/"), true);

//this when it does
g.filter("text", new RegExp("/Airport$/"), true);

The two doesn't really work out.
Some help needed please.


9 Feb 2010, 5:10 AM
Clarifying a bit my needs I would say I need to create a RegExp that is the negation of "Airport".
When I input g.filter("text", "Airport"), true); it filters out well the records with the word Airport, now I want the opposite query.