Skip to content

Instantly share code, notes, and snippets.

View forcementor's full-sized avatar

Don Robins forcementor

View GitHub Profile
@forcementor
forcementor / JSON.Request.Stub1
Created October 17, 2012 21:33
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - JSON stub
{"action":"PocketCRMLeadController","method":"Edit","data":[[{"LastName":"Rogers","Id":"00Q5000000TXUh7EAH"}]],"type":"rpc","tid":8,"ctx":{"csrf":"RJwzNCf17ZNm_6plAMNqSGf5xEWfwVJcR4CPtjMVb4a2g38HryRgL0jyVfAn2GNyUSd.PHPwsl5sptP607AXKgFvCnGIKGLnvExkZV9ILTLCHMNdIjTHsdKYMwVYe2JNSfnZ8THOvpEld6_.px3lKp3rcx_q7NAX1oClG13LQCYR1BY_","vid":"06650000000D9rZ","ns":"","ver":25}}
@forcementor
forcementor / QueryRequest.Stub
Created October 17, 2012 21:32
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - QueryRequest stub
...
limitParam: 'recordCount', // maps to QueryRequest.recordCount
...
}
(Apex)
public class QueryRequest {
...
Integer recordCount;
...
@forcementor
forcementor / PocketCRM.model.Lead2
Created October 17, 2012 21:31
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - Modify the Model
//The Lead model will include whatever fields are necssary to manage.
Ext.define("PocketCRM.model.Lead", {
extend: "Ext.data.Model",
config: {
idProperty: 'Id',
fields: [
{
name: 'Id',
@forcementor
forcementor / PocketCRMLeadController2.cls
Created October 17, 2012 21:29
Developing Mobile…Force.com and Sencha-Part 2, Step 7: Add Apex Remoting - Modify Apex Controller
public with sharing class PocketCRMLeadController {
public PocketCRMLeadController() {}
//========================================================================
//INNER CLASSES
//These support data request/response transport for remoting.
//========================================================================
// One of the parameters supplied by the DirectProxy read method.
@forcementor
forcementor / PocketCRM.store.Leads
Created October 17, 2012 21:25
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.
@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();
@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.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 / 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 / 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: [{