Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save forcementor/3907154 to your computer and use it in GitHub Desktop.
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 6: Build Out The Sencha Touch Application - Add a Controller
//==============================================================================================
//CONTROLLERS
//Controllers manage the communication of your application and the coordination between the
//views and the model; they listen for the events emitted by the views and react accordingly.
//==============================================================================================
//The controller for the Leads list view
Ext.define("PocketCRM.controller.Leads", {
extend: "Ext.app.Controller",
config: {},
// Base Class functions.
launch: function () {
console.log("launch");
this.callParent(arguments);
//Load up the Store associated with the controller and its views.
console.log("load Leads");
var leadsStore = Ext.getStore("Leads");
leadsStore.load();
},
init: function () {
this.callParent(arguments);
console.log("init");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment