[Lada-commits] [PATCH 1 of 2] Enable multiselect in probe list and download LAF export via POST request
Wald Commits
scm-commit at wald.intevation.org
Wed Sep 4 09:54:29 CEST 2013
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1378281382 -7200
# Node ID 4fdc09ebf21db7ca11a2fe4838f1c34367a2a050
# Parent 3d81da9dac1cac96fd86777b92441850e943ac36
Enable multiselect in probe list and download LAF export via POST request.
diff -r 3d81da9dac1c -r 4fdc09ebf21d app/controller/Proben.js
--- 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');
diff -r 3d81da9dac1c -r 4fdc09ebf21d app/view/proben/List.js
--- 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.',
More information about the Lada-commits
mailing list