Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleTerms.bjs
index b4d5327..b97e23f 100644 (file)
                                                 },
                                                 {
                                                     "listeners" : {
-                                                        "|click" : "function()\n{\n     Pman.genericDelete(_this, 'ipshead'); \n}\n        "
+                                                        "|click" : "function()\n{\n    var sel = _this.grid.getSelectionModel().getSelected();\n\n    if(!sel || sel.data.terms_id * 1 < 1){\n        Roo.MessageBox.alert(\"Error\", \"Please select a terms\");\n        return;\n    }\n    \n    Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete the terms?\",\n        function(r) {\n            if (r != 'yes') {\n                return;\n            }\n           new Pman.Request({\n                url : baseURL + '/Roo/terms.php',\n                method : 'POST',\n                params : {\n                    _delete : sel.data.terms_id * 1\n                }, \n                success : function(res) {\n                    _this.grid.footer.onClick('first');\n                }\n            }); \n            \n            return;\n        }\n    );\n    \n}\n        "
                                                     },
                                                     "text" : "Delete",
                                                     "xtype" : "Button",