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

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

index 9547d1c..a243220 100644 (file)
                                             "xtype": "Button",
                                             "|xns": "Roo.Toolbar"
                                         },
+                                        {
+                                            "listeners": {
+                                                "|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.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        "
index 616eba5..7a02248 100644 (file)
@@ -968,6 +968,41 @@ Pman.Dialog.XtupleVendorEdit = {
                                     cls : 'x-btn-text-icon',
                                     text : "Delete",
                                     icon : rootURL + '/Pman/templates/images/trash.gif'
+                                },
+                                {
+                                    xtype: 'Button',
+                                    xns: Roo.Toolbar,
+                                    listeners : {
+                                        click : function()
+                                        {
+                                             var s = _this.agrid.getSelectionModel().getSelected();
+                                             
+                                             if(!s || s.data.vendaddr_id * 1 < 1){
+                                                Roo.MessageBox.alert('Error', 'Please select a row');
+                                                return;
+                                             }
+                                             
+                                             Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete that?",
+                                                function(v) {
+                                                    if (v != 'yes') {
+                                                        return;
+                                                    }
+                                                     new Pman.Request({
+                                                        method: 'POST',
+                                                        url: baseURL+ '/Roo/vendaddrinfo',
+                                                        params : {
+                                                            _delete : s.data.vendaddr_id
+                                                        },
+                                                        success : function() {
+                                                            _this.agrid.footer.onClick('refresh');
+                                                        }
+                                                    });
+                                            });
+                                        }
+                                    },
+                                    cls : 'x-btn-text-icon',
+                                    text : "Delete",
+                                    icon : rootURL + '/Pman/templates/images/trash.gif'
                                 }
                             ]
                         },