Skip to content

Instantly share code, notes, and snippets.

@forcementor
Created October 17, 2012 21:25
Show Gist options
  • Select an option

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

Select an option

Save forcementor/3908312 to your computer and use it in GitHub Desktop.
Developing Mobile…Force.com and Sencha-Part 2, Step 7: Add Apex Remoting - Modify Store
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.
//THE LINE BELOW MUST BE REMOVED AFTER ADDING DATA PROXY LATER!
data: {!Leads},
autoLoad: true,
pageSize: 50,
//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