PDA

View Full Version : How to do grid store filter by multiple values



santhu227
1 Oct 2012, 2:50 AM
This what code i used but it is not working
Store.filter( { property: 'Type', value: '1', anyMatch: true ,caseSensitive: false },
{ property: 'Name', value: Search, anyMatch: true ,caseSensitive: false }
);


please help me.

thx
Santhosh

Legolas
1 Oct 2012, 3:37 AM
santhu227, in accordance the documentation, filter (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-filter) method should receive an array of filters, try this:

Store.filter([
{ property: 'Type', value: '1', anyMatch: true ,caseSensitive: false },
{ property: 'Name', value: Search, anyMatch: true ,caseSensitive: false }
]);

In the second object, you declare the reference "Search", if this reference not exist will throw an error.