Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleVendorEdit.bjs
index 07e559d..21f9966 100644 (file)
                                         },
                                         {
                                             "listeners": {
-                                                "|click": "function()\n{\n     Pman.genericDelete(_this, 'itemsrc'); \n}\n        "
+                                                "|click": "function()\n{\n     var s = _this.agrid.getSelectionModel().getSelected();\n     \n     if(!s || s.data.vendaddr_id * 1 < 1){\n        Roo.MessageBox.alert('Error', 'Please select a row');\n        return;\n     }\n     \n     Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete that?\",\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                    _delete : s.data.vendaddr_id\n                },\n                success : function() {\n                    _this.agrid.footer.onClick('refresh');\n                }\n            });\n    });\n}\n        "
                                             },
                                             "cls": "x-btn-text-icon",
                                             "text": "Delete",
                                             "xtype": "Button",
                                             "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
                                             "|xns": "Roo.Toolbar"
+                                        },
+                                        {
+                                            "listeners": {
+                                                "|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                    vend_id : s,\n                    _remove_addr : 1\n                },\n                success : function() {\n                    _this.agrid.footer.onClick('refresh');\n                }\n            });\n    });\n}\n        "
+                                            },
+                                            "cls": "x-btn-text-icon",
+                                            "text": "Delete All",
+                                            "xtype": "Button",
+                                            "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
+                                            "|xns": "Roo.Toolbar"
                                         }
                                     ]
                                 },