Pman.Dialog.Image.bjs
authorjohn <john@roojs.com>
Mon, 4 Dec 2017 05:21:58 +0000 (13:21 +0800)
committerjohn <john@roojs.com>
Mon, 4 Dec 2017 05:21:58 +0000 (13:21 +0800)
Pman.Dialog.Image.js

Pman.Dialog.Image.bjs
Pman.Dialog.Image.js

index 404eff1..edd659d 100644 (file)
@@ -27,6 +27,7 @@
      "items" : [
       {
        "listeners" : {
+        "actionfailed" : "function (_self, action)\n{\n    _this.dialog.uploadComplete = true;\n    \n     _this.dialog.haveProgress = 2;\n     \n    if (action.type == 'submit') {\n        Roo.log(\"Upload error\");\n        Roo.log(action);\n        \n        try {\n            \n            Roo.MessageBox.alert(\"Error\", action.result.errorMsg.split(/\\n/).join('<BR/>'));\n            \n        } catch(e) {\n            \n            Roo.MessageBox.alert(\"Error\", \"Saving failed = fix errors and try again\");\n        }\n        return;\n    }\n    \n    Roo.MessageBox.alert(\"Error\", \"Error loading details\"); \n}",
         "actioncomplete" : "function(_self,action)\n{\n    _this.dialog.uploadComplete = true;\n    \n    _this.dialog.haveProgress = 2;\n    \n    Roo.MessageBox.hide();\n     \n    if (action.type == 'setdata') { \n        \n        /*\n        _this.form.findField('imgtype').hide();\n        \n        if(_this.data._show_image_type){\n            _this.form.findField('imgtype').show();\n        }\n        */\n        \n        this.url = _this.data._url ? _this.data._url : baseURL + '/Roo/Images.php';\n        this.el.dom.action = this.url;\n        if (typeof(_this.data.timeout) != 'undefined') {\n            this.timeout = _this.data.timeout;\n        }\n        \n        this.findField('UPLOAD_IDENTIFIER').setValue(\n            (new Date() * 1) + '' + Math.random());\n            \n        return;\n    }\n     \n   \n    if (action.type == 'load') {\n        \n        _this.data = action.result.data;\n        \n        return;\n    }\n    \n    \n    if (action.type == 'submit') { // only submitted here if we are \n        _this.dialog.hide();\n        Roo.log(\"Upload success\");\n        Roo.log(action);\n        if (_this.callback) {\n            _this.callback.call(this, action.result.data, action.result.extra);\n        }\n        return; \n    }\n \n\n    \n}\n",
         "render" : "function (_self)\n{\n    _this.form = this;\n}"
        },
index f6951a0..f33ec25 100644 (file)
@@ -192,6 +192,29 @@ Roo.apply(Pman.Dialog.Image.prototype, {
            
           
               
+          },
+         actionfailed : function (_self, action)
+          {
+              _this.dialog.uploadComplete = true;
+              
+               _this.dialog.haveProgress = 2;
+               
+              if (action.type == 'submit') {
+                  Roo.log("Upload error");
+                  Roo.log(action);
+                  
+                  try {
+                      
+                      Roo.MessageBox.alert("Error", action.result.errorMsg.split(/\n/).join('<BR/>'));
+                      
+                  } catch(e) {
+                      
+                      Roo.MessageBox.alert("Error", "Saving failed = fix errors and try again");
+                  }
+                  return;
+              }
+              
+              Roo.MessageBox.alert("Error", "Error loading details"); 
           },
          render : function (_self)
           {