Skip to content

Instantly share code, notes, and snippets.

View forcementor's full-sized avatar

Don Robins forcementor

View GitHub Profile
@forcementor
forcementor / PocketCRM.view.LeadsList
Created October 17, 2012 21:18
Developing Mobile…Force.com and Sencha-Part 2, Step 1: Add Controls and Event Handling
//The Lead list view.
Ext.define("PocketCRM.view.LeadsList", {
extend: "Ext.Container",
//It uses the base list class.
requires: "Ext.dataview.List",
alias: "widget.leadslistview",
config: {
@forcementor
forcementor / LaunchURL
Created October 17, 2012 18:46
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 8: Demo Version One of PocketCRM
https://c.{SERVER_NAME}.visual.force.com/apex/PocketCRM
@forcementor
forcementor / PocketCRM_APP1.store2.component
Created October 17, 2012 18:40
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
@forcementor
forcementor / PocketCRM_APP1.2.withcontroller.component
Created October 17, 2012 18:37
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 7: Replace Your Mock Data With The Real Thing - Add Controller ref to Component
<apex:component controller="PocketCRMLeadController" >
@forcementor
forcementor / PocketCRMLeadController1.cls
Created October 17, 2012 18:34
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 7: Replace Your Mock Data With The Real Thing - Apex Controller
public class PocketCRMLeadController {
private string leads;
//Constructor.
public PocketCRMLeadController() {
//Fetch a limited set of Leads to return to the Sencha Data Store on load.
List < Lead > leadsList = [SELECT
FirstName
, LastName
@forcementor
forcementor / pocketCRM_APP1.JSON.component
Created October 17, 2012 18:31
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 6: Build Out The Sencha Touch Application - Generate Some Lead JSON
//Run this code in an APEX Execute Anonymous window:
List<Lead> leadList = [SELECT FirstName ,LastName ,Company ,Title ,Phone ,Email ,Status FROM Lead LIMIT 5];
system.debug(JSON.serializePretty(leadList));
/*Your results will be as follows in the DEBUG LOG.
*Find the USER_DEBUG line and copy all the JSON
*starting with the '[' delimiter thru the ending ']' delimiter
*and paste into your data store as the data content.
*The 'attributes' content is not used by Sencha, but you
*don't have to remove them as they will simply be ignored.
@forcementor
forcementor / PocketCRM_APP1.finishedApp.component
Created October 17, 2012 18:23
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 6: Build Out The Sencha Touch Application - Complete the Application
Ext.application({
name: "PocketCRM",
//Load the various MVC components into memory.
models: ["Lead"],
stores: ["Leads"],
controllers: ["Leads"],
views: ["LeadsList"],
//The application's startup routine once all components are loaded.
@forcementor
forcementor / PocketCRM_APP1.listview.component
Created October 17, 2012 18:21
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 6: Build Out The Sencha Touch Application - Add a View for the List
//==============================================================================================
//VIEWS
//Views display data to your users and gather input from them;
//they also emit events about your user interaction.
//==============================================================================================
//The Lead list view.
Ext.define("PocketCRM.view.LeadsList", {
extend: "Ext.Container",
//It uses the base list class.
@forcementor
forcementor / pocketCRM_APP1.controller.component
Created October 17, 2012 18:19
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: {},
@forcementor
forcementor / PocketCRM_APP1.model.component
Created October 17, 2012 18:17
Developing Mobile Applications with Force.com and Sencha Touch - Part 1, Step 6: Build Out The Sencha Touch Application - Add a Data Model
//==============================================================================================
//MODELS
//Models are the objects on your application.
//==============================================================================================
//The Lead model will include whatever fields are necssary to manage.
Ext.define("PocketCRM.model.Lead", {
extend: "Ext.data.Model",
config: {