{
"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",
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',