Created
October 17, 2012 21:36
-
-
Save forcementor/3908402 to your computer and use it in GitHub Desktop.
Developing Mobile…Force.com and Sencha-Part 2, Step 8: Adjusting the Model and Adding a Data Proxy - Controller Init stub
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) { | |
| Ext.Msg.alert('Error', response.errorMessage); | |
| } else { | |
| Ext.Msg.alert('Error', operation.config.action + ' failed: ' + response.errorMessage); | |
| } | |
| } else { | |
| Ext.Msg.alert('Error', operation.config.action + ' failed for an unknown reason: proxy = ' + proxy); | |
| } | |
| }); | |
| }, |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed for bug on improper object references, now properly displays error messages passed back from the Apex controller.