Skip to content

Instantly share code, notes, and snippets.

@forcementor
Created October 17, 2012 18:40
Show Gist options
  • Select an option

  • Save forcementor/3907288 to your computer and use it in GitHub Desktop.

Select an option

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