View Full Version : store filter - like operatior

5 Nov 2012, 2:30 AM
I have used filter on store like below

but I want to filter the store based on wild characters - ie., filter all records which starts with "Ro"

I want to fetch all names which starts with "Ro"

like how we do in oracle- select * from X where name like 'Ro%'

5 Nov 2012, 2:45 AM
Your request is default behavior of store.filter(field, value).

5 Nov 2012, 3:01 AM
no it doesnt work
if am doing this - egg.filter('allergenCategotyCode','FA');
this give me 5 records

if am doing this - egg.filter('allergenCategotyCode','A');
this give me 0 records

5 Nov 2012, 3:36 AM
you asked for starting with some character(s). this is possible with store.filter(). If you filter with 'F' instead of 'A', you should get 5 or more records (including the ones with 'FA'). Its not possible to filter with a character in the middle of some field value using store.filter() as far as I know.

5 Nov 2012, 4:55 AM
If you would like to match characters that does not depend on position then you should use the following syntax:

property: fieldName,
value: valueToMatch,
anyMatch: true,
caseSensitive: false

See more filter config here http://docs.sencha.com/ext-js/4-1/#!/api/Ext.util.Filter.

5 Nov 2012, 5:17 AM
this works.. thank you very much