Skip to content

Instantly share code, notes, and snippets.

View forcementor's full-sized avatar

Don Robins forcementor

View GitHub Profile
@forcementor
forcementor / PocketCRM.store.Leads
Created October 22, 2012 00:32
Developing Mobile…Force.com and Sencha-Part 3, Step 1: Reset page size
Ext.define("PocketCRM.store.Leads", {
extend: "Ext.data.Store",
requires: "Ext.data.proxy.LocalStorage",
config: {
model: "PocketCRM.model.Lead",
autoLoad: true,
//Set your desired PAGE SIZE.
pageSize: 25,
groupField: "Status",
@forcementor
forcementor / listview.component
Created October 22, 2012 00:28
Developing Mobile…Force.com and Sencha-Part 3, Step 1: Add List Paging Plugin
//The main list and its properties.
xtype: "list",
store: "Leads",
itemId: "leadsList",
...
disableSelection: false,
...
plugins: [{
xclass: 'Ext.plugin.ListPaging',
@forcementor
forcementor / PocketCRM.page
Last active October 11, 2015 21:18
Developing Mobile Applications with Force.com and Sencha Touch - Part 2 - Complete Project
<!--
========================================================
Name: PocketCRM
Type: Visualforce Page
Purpose: For Sencha Touch PocketCRM App
Created by: Don Robins - www.ForceMentor.com
Created on: August 1, 2012
Copyright 2012 Outformations, Inc.
Rev # Revised on Revised by Revision Description
@forcementor
forcementor / PocketCRM.page
Created October 18, 2012 17:07
Developing Mobile Applications with Force.com and Sencha Touch - Part 1 - Complete Project
<!--
========================================================
Name: PocketCRM
Type: Visualforce Page
Purpose: For Sencha Touch PocketCRM App
Created by: Don Robins - www.ForceMentor.com
Created on: August 1, 2012
Copyright 2012 Outformations, Inc.
Rev # Revised on Revised by Revision Description
@forcementor
forcementor / requestCallback.stub
Created October 17, 2012 21:37
Developing Mobile…Force.com and Sencha-Part 2, Step 9: Adjusting Our Proxy To Work With Visualforce Remoting - Controller Tweaks 2
Ext.data.proxy.Direct.prototype.createRequestCallback = function (request, operation, callback, scope) {
var me = this;
return function (data, event) {
console.log('createRequestCallback: ' + operation);
me.processResponse(event.status, operation, request, data, callback, scope);
};
};
@forcementor
forcementor / getArgs.stub
Created October 17, 2012 21:36
Developing Mobile…Force.com and Sencha-Part 2, Step 9: Adjusting Our Proxy To Work With Visualforce Remoting - Controller Tweaks 1
//Adjust our read method to add a function that Touch expects to see to get Arguments.
PocketCRMLeadController.Query.directCfg.method.getArgs = function (params, paramOrder, paramsAsHash) {
console.log('getArgs: ' + params.data);
return [params]
}
@forcementor
forcementor / controller.init
Created October 17, 2012 21:36
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - Controller Init stub
init: function () {
this.callParent(arguments);
console.log("init");
//Listen for exceptions observed by the proxy so we can report them and clean up.
//20121016 Fixed for bug on improper object references
Ext.getStore('Leads').getProxy().addListener('exception', function (proxy, response, operation, options) {
// only certain kinds of errors seem to have useful information returned from the server
if (response) {
if (response.errorMessage) {
@forcementor
forcementor / controller.launch
Created October 17, 2012 21:35
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - Controller Launch stub
// 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();
},
@forcementor
forcementor / onSaveLeadCommand.validation2
Created October 17, 2012 21:34
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - Validation Stub 2
validations: [
{ type: 'presence', field: 'LastName', message: 'Enter a last name.' },
...
@forcementor
forcementor / onSaveLeadCommand.validation1
Created October 17, 2012 21:33
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - Validation Stub 1
onSaveLeadCommand: function () {
console.log("onSaveLeadCommand");...
//Check for validation errors.
var errors = currentLead.validate();
if (!errors.isValid()) {
var msg = '';
errors.each(function (error) {
msg += error.getMessage() + '<br/>';