Pman.Dialog.CoreCompanies.bjs
[Pman.Core] / Pman.Dialog.CoreCompanies.bjs
index 95641ae..f61ed87 100644 (file)
     },
     {
      "listeners" : {
-      "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_company.php',\n        method : 'POST',\n        params : {\n          id : _this.form.findField('id').getValue() * 1,\n          name : _this.form.findField('name').getValue(),\n          _check_name : 1\n        }, \n        success : function(res) {\n            _this.dialog.el.mask(\"Saving\");\n            _this.form.doAction(\"submit\");\n        },\n        failure : function(res) {\n            Roo.log(res);\n        }\n    });\n    \n    return;\n    \n}"
+      "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_company.php',\n        method : 'POST',\n        params : {\n          id : _this.form.findField('id').getValue() * 1,\n          name : _this.form.findField('name').getValue(),\n          _check_name : 1\n        }, \n        success : function(res) {\n            _this.dialog.el.mask(\"Saving\");\n            _this.form.doAction(\"submit\");\n        },\n        failure : function(res) {\n            Roo.MessageBox.confirm(\n                \"Confirm\", \n                \"The company name has been used. Save it anyway?\", \n                function(res) {\n                    if(res != 'yes') {\n                        return;\n                    }\n                    \n                    _this.dialog.el.mask(\"Saving\");\n                    _this.form.doAction(\"submit\");\n                }\n            );\n        }\n    });\n    \n    return;\n    \n}"
      },
      "text" : "Save",
      "xtype" : "Button",