comparison app/controller/Proben.js @ 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 0fa48c66cf7d
children 91193c49c2bb
comparison
equal deleted inserted replaced
380:eb79d9bf3929 381:9bc080ecdbc9
66 click: this.addItem 66 click: this.addItem
67 }, 67 },
68 'probenlist toolbar button[action=import]': { 68 'probenlist toolbar button[action=import]': {
69 click: this.selectUploadFile 69 click: this.selectUploadFile
70 }, 70 },
71 'probenlist toolbar button[action=export]': {
72 click: this.downloadFile
73 },
71 'probencreate button[action=save]': { 74 'probencreate button[action=save]': {
72 click: this.saveItem 75 click: this.saveItem
73 }, 76 },
74 'probenedit button[action=save]': { 77 'probenedit button[action=save]': {
75 click: this.saveItem 78 click: this.saveItem
126 win.close(); 129 win.close();
127 } 130 }
128 }); 131 });
129 } 132 }
130 }, 133 },
134 /**
135 * Will download the selected Probe in LAF format in a new window (tab).
136 */
137 downloadFile: function(button) {
138 var grid = button.up('grid');
139 var selection = grid.getView().getSelectionModel().getSelection()[0];
140 var url = "server/rest/export/laf/" + selection.get('probeId');
141 window.open(url, "_blank");
142 },
131 editItem: function(grid, record) { 143 editItem: function(grid, record) {
132 console.log('Editing Probe'); 144 console.log('Editing Probe');
133 var id = record.get('probeId'); 145 var id = record.get('probeId');
134 // Load Zusatzwerte 146 // Load Zusatzwerte
135 var pstore = this.getProbenzusatzwerteStore(); 147 var pstore = this.getProbenzusatzwerteStore();

http://lada.wald.intevation.org