Pman.Dialog.XtupleVendorEdit.bjs
authorEdward <edward@roojs.com>
Thu, 30 Jan 2014 05:45:43 +0000 (13:45 +0800)
committerEdward <edward@roojs.com>
Thu, 30 Jan 2014 05:45:43 +0000 (13:45 +0800)
Pman.Dialog.XtupleVendorEdit.js

Pman.Dialog.XtupleVendorEdit.bjs
Pman.Dialog.XtupleVendorEdit.js

index bd40eea..cfec53e 100644 (file)
                                         },
                                         {
                                             "listeners": {
-                                                "|click": "function()\n{\n     Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete all the address?\",\n        function(v) {\n            if (v != 'yes') {\n                return;\n            }\n             new Pman.Request({\n                method: 'POST',\n                url: baseURL+ '/Roo/vendaddrinfo',\n                params : {\n                    vendaddr_id : s.data.vendaddr_id,\n                    _deleteAll : 1\n                },\n                success : function() {\n                    _this.agrid.footer.onClick('refresh');\n                }\n            });\n    });\n}\n        "
+                                                "|click": "function()\n{\n     var s = _this.form.findField('vend_id').getValue() * 1;\n     \n     if(!s || s * 1 < 1){\n        Roo.MessageBox.alert('Error', 'Save first!');\n        return;\n     }\n     \n     Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete all the address?\",\n        function(v) {\n            if (v != 'yes') {\n                return;\n            }\n             new Pman.Request({\n                method: 'POST',\n                url: baseURL+ '/Roo/vendinfo',\n                params : {\n                    vendaddr_vend_id : s,\n                    _deleteAll : 1\n                },\n                success : function() {\n                    _this.agrid.footer.onClick('refresh');\n                }\n            });\n    });\n}\n        "
                                             },
                                             "cls": "x-btn-text-icon",
                                             "text": "Delete All",
index 31bd1a4..332a12a 100644 (file)
@@ -975,6 +975,13 @@ Pman.Dialog.XtupleVendorEdit = {
                                     listeners : {
                                         click : function()
                                         {
+                                             var s = _this.form.findField('vend_id').getValue() * 1;
+                                             
+                                             if(!s || s * 1 < 1){
+                                                Roo.MessageBox.alert('Error', 'Save first!');
+                                                return;
+                                             }
+                                             
                                              Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete all the address?",
                                                 function(v) {
                                                     if (v != 'yes') {
@@ -982,9 +989,9 @@ Pman.Dialog.XtupleVendorEdit = {
                                                     }
                                                      new Pman.Request({
                                                         method: 'POST',
-                                                        url: baseURL+ '/Roo/vendaddrinfo',
+                                                        url: baseURL+ '/Roo/vendinfo',
                                                         params : {
-                                                            vendaddr_id : s.data.vendaddr_id,
+                                                            vendaddr_vend_id : s,
                                                             _deleteAll : 1
                                                         },
                                                         success : function() {