comparison app/controller/Proben.js @ 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 c5188d71ef87
children 85238577adc9
comparison
equal deleted inserted replaced
398:3d81da9dac1c 400:4fdc09ebf21d
153 /** 153 /**
154 * Will download the selected Probe in LAF format in a new window (tab). 154 * Will download the selected Probe in LAF format in a new window (tab).
155 */ 155 */
156 downloadFile: function(button) { 156 downloadFile: function(button) {
157 var grid = button.up('grid'); 157 var grid = button.up('grid');
158 var selection = grid.getView().getSelectionModel().getSelection()[0]; 158 var selection = grid.getView().getSelectionModel().getSelection();
159 var url = "server/rest/export/laf/" + selection.get('probeId'); 159 var hiddenItems = [];
160 window.open(url, "_blank"); 160 for (var i = 0; i < selection.length; i++) {
161 hiddenItems.push({xtype: 'hiddenfield', name: 'probeId', value: selection[i].get('probeId')});
162 }
163 console.log('create download form.');
164 var hiddenForm = Ext.create('Ext.form.Panel', {
165 title: 'hiddenForm',
166 standardSubmit: true,
167 url: 'server/rest/export/laf',
168 timeout: 120,
169 height: 0,
170 width: 0,
171 hidden: true,
172 items: hiddenItems
173 });
174 hiddenForm.getForm().submit();
161 }, 175 },
162 editItem: function(grid, record) { 176 editItem: function(grid, record) {
163 console.log('Editing Probe'); 177 console.log('Editing Probe');
164 var id = record.get('probeId'); 178 var id = record.get('probeId');
165 // Load Zusatzwerte 179 // Load Zusatzwerte

http://lada.wald.intevation.org