Pman.Tab.AdminEmailTemplates.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 3 Jun 2016 05:28:01 +0000 (13:28 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 3 Jun 2016 05:28:01 +0000 (13:28 +0800)
Pman.Tab.AdminEmailTemplates.js

Pman.Tab.AdminEmailTemplates.bjs
Pman.Tab.AdminEmailTemplates.js

index 900e072..7b0a484 100644 (file)
            "items" : [
             {
              "listeners" : {
-              "|click" : "function()\n{\n  var sel = _this.grid.selModel.getSelected();\n  if (!sel) {\n        Roo.MessageBox.alert(\"Error\", \"Select a message to copy\");\n        return;\n    }\nnew 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.grid.footer.onClick('refresh');\n    }\n});\n  \n}\n"
+              "|click" : "function()\n{\n   \nnew Pman.Download({\n    url : baseURL + '/Roo/Core_email',\n    method : 'GET',\n    params : {\n        csvCols : '*',\n        csvTitles : '*',\n    }\n});\nRoo.MessageBox.alert(\"Notice\", \"Should be downloading now\");\n  \n}\n"
              },
              "text" : "Download to Excel",
              "xtype" : "Button",
index a8558ef..dec3ed3 100644 (file)
@@ -124,22 +124,16 @@ Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
           listeners : {
            click : function()
             {
-              var sel = _this.grid.selModel.getSelected();
-              if (!sel) {
-                    Roo.MessageBox.alert("Error", "Select a message to copy");
-                    return;
-                }
-            new Pman.Request({
+               
+            new Pman.Download({
                 url : baseURL + '/Roo/Core_email',
-                method : 'POST',
+                method : 'GET',
                 params : {
-                    id : sel.data.id,
-                    _make_copy : 1
-                },
-                success : function() {
-                    _this.grid.footer.onClick('refresh');
+                    csvCols : '*',
+                    csvTitles : '*',
                 }
             });
+            Roo.MessageBox.alert("Notice", "Should be downloading now");
               
             }
           },