In this recipe, we will see how to group the data and how to send the grouping information to the server application.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
var store = new Ext.data.Store({ model: 'User', autoLoad: true, proxy: { type: 'ajax', url: 'users.json', reader: { type: 'json', root: 'users' }, remoteSort: true, groupField: 'age', groupDir: 'ASC' } });
The preceding code shows how to specify the grouping information and send it to the server. The related properties are groupField
and groupDir
. The groupField
property instructs the model field on which data needs to be grouped and the groupDir
property instructs the direction—ascending or descending. Grouping information is treated in a similar way to the sort information. Grouping information is passed as the...