This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //The main list and its properties. | |
| xtype: "list", | |
| store: "Leads", | |
| itemId: "leadsList", | |
| ... | |
| disableSelection: false, | |
| ... | |
| plugins: [{ | |
| xclass: 'Ext.plugin.ListPaging', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| ======================================================== | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| ======================================================== | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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(); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| validations: [ | |
| { type: 'presence', field: 'LastName', message: 'Enter a last name.' }, | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/>'; |