Filtering is a great way to remove unwanted records based on certain criteria. A store allows us to specify the filters and additional properties to send the filter information to the server application. One or more filters can be applied. In this recipe, we will see how to do this.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
The following code highlights the property and method that needs to be used in order to apply the filtering:
var store = new Ext.data.Store({ model: 'User', autoLoad: true, proxy: { type: 'ajax', url: 'users.json', reader: { type: 'json', root: 'users' }, remoteFilter: true } }); store.filter([ { property: 'name', value : /Aj/ } ]);