Pman.Tab.BAdminEmailTemplates.bjs
authoredward <edward@roojs.com>
Tue, 6 Feb 2018 09:35:51 +0000 (17:35 +0800)
committeredward <edward@roojs.com>
Tue, 6 Feb 2018 09:35:51 +0000 (17:35 +0800)
Pman.Tab.BAdminEmailTemplates.js

Pman.Tab.BAdminEmailTemplates.bjs
Pman.Tab.BAdminEmailTemplates.js

index 16bb556..dcb0bf6 100644 (file)
                     {
                      "listeners" : {
                       "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
-                      "click" : "function (_self, e)\n{\n    var sel = _this.grid.grid.selModel.getSelected();\n    if (!sel) {\n        Roo.MessageBox.alert(\"Error\", \"Select a message to copy\");\n        return;\n    }\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_email',\n        method : 'POST',\n        params : {\n            id : sel.data.id,\n            _make_copy : 1\n        },\n        success : function() {\n            _this.table.footer.onClick('refresh');\n        }\n    });\n}"
+                      "click" : "function (_self, e)\n{\n    var sel = _this.grid.grid.selModel.getSelected();\n    \n    if (!sel || sel.data.id * 1 < 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a message to edit\");\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_email',\n        method : 'POST',\n        params : {\n            id : sel.data.id,\n            _make_copy : 1\n        },\n        success : function() {\n            _this.table.footer.onClick('refresh');\n        }\n    });\n}"
                      },
                      "xtype" : "Button",
                      "$ xns" : "Roo.bootstrap",
index 6c4650e..77c0ebc 100644 (file)
@@ -224,10 +224,12 @@ Pman.Tab.BAdminEmailTemplates = new Roo.XComponent({
                     click : function (_self, e)
                      {
                          var sel = _this.grid.grid.selModel.getSelected();
-                         if (!sel) {
-                             Roo.MessageBox.alert("Error", "Select a message to copy");
+                         
+                         if (!sel || sel.data.id * 1 < 1) {
+                             Roo.MessageBox.alert("Error", "Select a message to edit");
                              return;
                          }
+                         
                          new Pman.Request({
                              url : baseURL + '/Roo/Core_email',
                              method : 'POST',