skuid model save returns 'done' promise despite missing required field warning

  • 2
  • Problem
  • Updated 3 years ago
  • (Edited)
Hello Skuid!

I am calling in a snippet like so:

'saveAllSnippet': function () {
var modelsToSave = [],
modelsToExclude = ['AddTests','ProcessLog','ChangeTracker','ShowTabs','UI_Model','DefaultTo','ChartAudit'],
dfd = new $.Deferred(); $.each(, function(){
if (this.hasChanged && (modelsToExclude.indexOf( === -1) && this.preventUnloadIfUnsavedChanges) { modelsToSave.push(this); }
}); $.when(
console.log('All Models Saved.'); dfd.resolve(); })
console.log('All Model Save Failed.'); dfd.reject(); });
return dfd.promise();

As you can see from the image below, the .done() response is being called from $.when() despite the fact that the model is throwing a missing required field error.

Photo of Matt Sones

Matt Sones, Champion

  • 32,106 Points 20k badge 2x thumb

Posted 3 years ago

  • 2

Be the first to post a reply!