comparison app/controller/FilterResult.js @ 725:83c571b022f3

Added window for laf file upload and use filtergrid buttons to export or import.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 16 Apr 2015 15:55:32 +0200
parents e0b966b32163
children e002234d7da5
comparison
equal deleted inserted replaced
724:876456ce0a01 725:83c571b022f3
39 }); 39 });
40 win.show(); 40 win.show();
41 win.initData(); 41 win.initData();
42 }, 42 },
43 43
44 addItem: function(button) { 44 addItem: function() {
45 var win = Ext.create('Lada.view.window.ProbeCreate'); 45 var win = Ext.create('Lada.view.window.ProbeCreate');
46 win.show(); 46 win.show();
47 win.initData(); 47 win.initData();
48
49 }, 48 },
50 49
51 uploadFile: function(button) { 50 uploadFile: function() {
51 var win = Ext.create('Lada.view.window.FileUpload', {
52 title: 'Datenimport',
53 modal: true
54 });
52 55
56 win.show();
53 }, 57 },
54 58
55 downloadFile: function(button) { 59 downloadFile: function(button) {
60 var grid = button.up('grid');
61 var selection = grid.getView().getSelectionModel().getSelection();
62 var proben = [];
63 for (var i = 0; i < selection.length; i++) {
64 proben.push(selection[i].get('id'));
65 }
56 66
67 Ext.Ajax.request({
68 method: 'POST',
69 url: '/lada-server/export/laf',
70 jsonData: {'proben': proben},
71 headers: {'X-OPENID-PARAMS': Lada.openIDParams},
72 success: function(response) {
73 var content = response.responseText;
74 var blob = new Blob([content],{type: 'text/plain'});
75 saveAs(blob, 'export.laf');
76 },
77 failure: function() {
78 Ext.Msg.alert('Fehler', 'Failed to create LAF-File!');
79 }
80 });
57 } 81 }
58 }); 82 });

http://lada.wald.intevation.org