Data grouping

In this recipe, we will see how to group the data and how to send the grouping information to the server application.

Getting ready

Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.

How to do it...

  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'
      }
  });

How it works...

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 ...

Get Sencha Touch Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.