Skip to content

Instantly share code, notes, and snippets.

View forcementor's full-sized avatar

Don Robins forcementor

View GitHub Profile
@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.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 / 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 / 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.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 / PocketCRM.view.LeadEditor
Created October 17, 2012 21:20
Developing Mobile…Force.com and Sencha-Part 2, Step 2: Add A Lead Form View
Ext.define("PocketCRM.view.LeadEditor", {
extend: "Ext.form.Panel",
requires: "Ext.form.FieldSet",
alias: "widget.leadeditorview",
config: {
scrollable: 'vertical',
items: [{
@forcementor
forcementor / PocketCRM.application.update1
Created October 17, 2012 21:21
Developing Mobile…Force.com and Sencha-Part 2, Step 3: Add The Form View To the Application
Ext.application({
name: "PocketCRM",
//Load the various MVC components into memory.
models: ["Lead"],
stores: ["Leads"],
controllers: ["Leads"],
views: ["LeadsList", "LeadEditor"],
@forcementor
forcementor / controller.config
Created October 17, 2012 21:22
Developing Mobile…Force.com and Sencha-Part 2, Step 4: Add Controller Event Handling
config: {
refs: {
// We're going to lookup our views by alias.
leadsListView: "leadslistview",
leadEditorView: "leadeditorview",
leadsList: "#leadsList"
},
control: {
@forcementor
forcementor / controller.transitions
Created October 17, 2012 21:23
Developing Mobile…Force.com and Sencha-Part 2, Step 5: Configure View Transitions
slideLeftTransition: {
type: 'slide',
direction: 'left'
},
slideRightTransition: {
type: 'slide',
direction: 'right'
},
//View Transition Helper functions
@forcementor
forcementor / controller.eventhandlers
Created October 17, 2012 21:24
Developing Mobile…Force.com and Sencha-Part 2, Step 6: Add Controller Event Handling Functions
onSyncLeadCommand: function () {
console.log("onSyncLeadCommand");
//Get a ref to the store and remove it.
var leadsStore = Ext.getStore("Leads");
//Resync the proxy, reload and activate the list.
leadsStore.sync();
leadsStore.load();
this.activateLeadsList();