Roo/form/BasicForm.js
authorAlan Knowles <alan@roojs.com>
Wed, 14 Mar 2012 04:39:52 +0000 (12:39 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 14 Mar 2012 04:39:52 +0000 (12:39 +0800)
Roo/form/BasicForm.js

index 8a1dac1..bbb42f2 100644 (file)
@@ -281,6 +281,24 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
         }else{
             
             // failure condition..
+            // we have a scenario where updates need confirming.
+            // eg. if a locking scenario exists..
+            // we look for { errors : { needs_confirm : true }} in the response.
+            if (typeof(action.result.errors.needs_confirm) != 'undefined') {
+                var _t = this;
+                Roo.MessageBox.confirm(
+                    "Change requires confirmation",
+                    action.result.errorMsg,
+                    function(r) {
+                        _t.doAction('submit', { params :  { _submit_confirmed : 1 } }  );
+                    }
+                    
+                );
+                
+                
+                
+                return;
+            }
             
             Roo.callback(o.failure, o.scope, [this, action]);
             // show an error message if no failed handler is set..