Created
October 17, 2012 18:40
-
-
Save forcementor/3907288 to your computer and use it in GitHub Desktop.
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 7: Replace Your Mock Data With The Real Thing - Modify the Data Store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //The Lead Store, this version will simply load with mock JSON data. | |
| Ext.define("PocketCRM.store.Leads", { | |
| extend: "Ext.data.Store", | |
| requires: "Ext.data.proxy.LocalStorage", | |
| config: { | |
| model: "PocketCRM.model.Lead", | |
| //Fetch the data from the custom Apex controller method | |
| //which will return a simple list of Leads as JSON on load. | |
| data: { | |
| !Leads | |
| }, | |
| //Create a grouping; be certain to use a field with content or you'll get errors! | |
| groupField: "Status", | |
| groupDir: "ASC", | |
| //Create additional sorts for within the Group. | |
| sorters: [{ | |
| property: 'LastName', | |
| direction: 'ASC' | |
| }, { | |
| property: 'FirstName', | |
| direction: 'ASC' | |
| }] | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment