Skip to content

Instantly share code, notes, and snippets.

@forcementor
Created October 17, 2012 21:33
Show Gist options
  • Select an option

  • Save forcementor/3908382 to your computer and use it in GitHub Desktop.

Select an option

Save forcementor/3908382 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 - 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/>';
});
console.log('Errors: ' + msg);
Ext.Msg.alert('Please correct errors!', msg, Ext.emptyFn);
currentLead.reject();
return;
}...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment