changeset 400:4fdc09ebf21d

Enable multiselect in probe list and download LAF export via POST request.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 04 Sep 2013 09:56:22 +0200
parents 3d81da9dac1c
children 87c1579f320d
files app/controller/Proben.js app/view/proben/List.js
diffstat 2 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Proben.js	Fri Aug 30 13:57:46 2013 +0200
+++ b/app/controller/Proben.js	Wed Sep 04 09:56:22 2013 +0200
@@ -155,9 +155,23 @@
      */
     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");
+        var selection = grid.getView().getSelectionModel().getSelection();
+        var hiddenItems = [];
+        for (var i = 0; i < selection.length; i++) {
+            hiddenItems.push({xtype: 'hiddenfield', name: 'probeId', value: selection[i].get('probeId')});
+        }
+        console.log('create download form.');
+        var hiddenForm = Ext.create('Ext.form.Panel', {
+            title: 'hiddenForm',
+            standardSubmit: true,
+            url: 'server/rest/export/laf',
+            timeout: 120,
+            height: 0,
+            width: 0,
+            hidden: true,
+            items: hiddenItems
+        });
+        hiddenForm.getForm().submit();
     },
     editItem: function(grid, record) {
         console.log('Editing Probe');
--- a/app/view/proben/List.js	Fri Aug 30 13:57:46 2013 +0200
+++ b/app/view/proben/List.js	Wed Sep 04 09:56:22 2013 +0200
@@ -5,6 +5,7 @@
     extend: 'Ext.grid.Panel',
     alias: 'widget.probenlist',
     store: 'ProbenList',
+    multiSelect: true,
     viewConfig: {
         maxHeight: 350,
         emptyText: 'Keine Proben gefunden.',

http://lada.wald.intevation.org