changeset 381:9bc080ecdbc9

Added action in controller to download the file in a new window.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 27 Aug 2013 10:40:14 +0200
parents eb79d9bf3929
children 91193c49c2bb
files app/controller/Proben.js gfx/document-save-as-6.png
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Proben.js	Tue Aug 27 10:14:30 2013 +0200
+++ b/app/controller/Proben.js	Tue Aug 27 10:40:14 2013 +0200
@@ -68,6 +68,9 @@
             'probenlist toolbar button[action=import]': {
                 click: this.selectUploadFile
             },
+            'probenlist toolbar button[action=export]': {
+                click: this.downloadFile
+            },
             'probencreate button[action=save]': {
                 click: this.saveItem
             },
@@ -128,6 +131,15 @@
             });
         }
     },
+    /**
+     * Will download the selected Probe in LAF format in a new window (tab).
+     */
+    downloadFile: function(button) {
+        var grid = button.up('grid');
+        var selection = grid.getView().getSelectionModel().getSelection()[0];
+        var url = "server/rest/export/laf/" + selection.get('probeId');
+        window.open(url, "_blank");
+    },
     editItem: function(grid, record) {
         console.log('Editing Probe');
         var id = record.get('probeId');
Binary file gfx/document-save-as-6.png has changed

http://lada.wald.intevation.org