Pman.Tab.XtupleReports.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 18 Dec 2013 13:41:06 +0000 (21:41 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 18 Dec 2013 13:41:06 +0000 (21:41 +0800)
Pman.Tab.XtupleReports.js

Pman.Tab.XtupleReports.bjs
Pman.Tab.XtupleReports.js

index 7dec76d..d66bd36 100644 (file)
                                 {
                                     "listeners": {
                                         "|render": "function() \n{\n    _this.vgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.vpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
-                                        "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
+                                        "|rowdblclick": "function (_self, rowIndex, e)\n{\n    var rec = this.ds.getAt(rowIndex);\n    new Pman.Download({\n        url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',\n        method : 'GET',\n        params : {\n            _id : rec.data.report_id,\n            _download : 1\n        }\n    });\n    Roo.MessageBox.alert(\"Downloading\",\n    \n       \"Report template is downloading - use \" +\n           '<a href=\"http://sourceforge.net/projects/openrpt/files/openrpt/\">' + \n           \"report writer to edit this\" + \n           '</a>'\n       );\n           \n    \n    \n}"
                                     },
                                     "*prop": "grid",
                                     "autoExpandColumn": "Report loaddate",
index d2235e2..6862de8 100644 (file)
@@ -288,10 +288,25 @@ Pman.Tab.XtupleReports = new Roo.XComponent({
                                 },
                                 rowdblclick : function (_self, rowIndex, e)
                                 {
-                                    if (!_this.dialog) return;
-                                    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
-                                        _this.grid.footer.onClick('first');
-                                    }); 
+                                    var rec = this.ds.getAt(rowIndex);
+                                    new Pman.Download({
+                                        url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',
+                                        method : 'GET',
+                                        params : {
+                                            _id : rec.data.report_id,
+                                            _download : 1
+                                        }
+                                    });
+                                    Roo.MessageBox.alert("Downloading",
+                                    
+                                       "Report template is downloading - use " +
+                                           '<a href="http://sourceforge.net/projects/openrpt/files/openrpt/">' + 
+                                           "report writer to edit this" + 
+                                           '</a>'
+                                       );
+                                           
+                                    
+                                    
                                 }
                             },
                             autoExpandColumn : 'Report loaddate',