jprism
jprism

Reputation: 3494

Ext JS: Filtering the store

I am running a weird reg ex issue. I am trying to filter the names starts with character A or a and use dataStore.filter("name", /^[Aa]*$/);

But for some reason, I get empty store.

Any help is appreciated

Tharahan

Upvotes: 0

Views: 601

Answers (1)

Derek
Derek

Reputation: 1196

Your regex is wrong. You're asking for the beginning of the string followed by any number of the letter a followed by the end of the string. The only things that will match are the empty string and string like A, a, Aa, aAAaaAaaaAAaa, etc.

Try this:

dataStore.filter('name',/^[Aa]/)

Upvotes: 2

Related Questions