Mercurial > lada > lada-client
comparison app/controller/FilterResult.js @ 742:6e28ebbe1a73
added documentation for Form and Grid controllers
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Thu, 23 Apr 2015 16:28:04 +0200 |
parents | e002234d7da5 |
children | 704bb359c0fe |
comparison
equal
deleted
inserted
replaced
740:2e8da590ea0c | 742:6e28ebbe1a73 |
---|---|
13 extend: 'Ext.app.Controller', | 13 extend: 'Ext.app.Controller', |
14 requires: [ | 14 requires: [ |
15 'Lada.view.window.ProbeEdit' | 15 'Lada.view.window.ProbeEdit' |
16 ], | 16 ], |
17 | 17 |
18 /** | |
19 * Initialize the Controller with 4 listeners | |
20 */ | |
18 init: function() { | 21 init: function() { |
19 this.control({ | 22 this.control({ |
20 'filterresultgrid': { | 23 'filterresultgrid': { |
21 itemdblclick: this.editItem | 24 itemdblclick: this.editItem |
22 }, | 25 }, |
31 } | 34 } |
32 }); | 35 }); |
33 this.callParent(arguments); | 36 this.callParent(arguments); |
34 }, | 37 }, |
35 | 38 |
39 /** | |
40 * This function is called after a Row in the | |
41 * {@link Lada.view.grid.FilterResult} | |
42 * was double-clicked. | |
43 * The function opens a {@link Lada.view.window.ProbeEdit} | |
44 */ | |
36 editItem: function(grid, record) { | 45 editItem: function(grid, record) { |
37 var win = Ext.create('Lada.view.window.ProbeEdit', { | 46 var win = Ext.create('Lada.view.window.ProbeEdit', { |
38 record: record | 47 record: record |
39 }); | 48 }); |
40 win.show(); | 49 win.show(); |
41 win.initData(); | 50 win.initData(); |
42 }, | 51 }, |
43 | 52 |
53 /** | |
54 * This function opens a new window to create a Probe | |
55 * {@link Lada.view.window.ProbeEdit} | |
56 */ | |
44 addItem: function() { | 57 addItem: function() { |
45 var win = Ext.create('Lada.view.window.ProbeCreate'); | 58 var win = Ext.create('Lada.view.window.ProbeCreate'); |
46 win.show(); | 59 win.show(); |
47 win.initData(); | 60 win.initData(); |
48 }, | 61 }, |
49 | 62 |
63 /** | |
64 * This function opens a {@link Lada.view.window.FileUpload} | |
65 * window to upload a LAF-File | |
66 */ | |
50 uploadFile: function() { | 67 uploadFile: function() { |
51 var win = Ext.create('Lada.view.window.FileUpload', { | 68 var win = Ext.create('Lada.view.window.FileUpload', { |
52 title: 'Datenimport', | 69 title: 'Datenimport', |
53 modal: true | 70 modal: true |
54 }); | 71 }); |
55 | 72 |
56 win.show(); | 73 win.show(); |
57 }, | 74 }, |
58 | 75 |
76 /** | |
77 * This function can be used to Download the items which | |
78 * were selected in the {@link Lada.view.grid.FilterResult} | |
79 * The Download does not work with Internet Explorers older than v.10 | |
80 */ | |
59 downloadFile: function(button) { | 81 downloadFile: function(button) { |
60 var grid = button.up('grid'); | 82 var grid = button.up('grid'); |
61 var selection = grid.getView().getSelectionModel().getSelection(); | 83 var selection = grid.getView().getSelectionModel().getSelection(); |
62 var proben = []; | 84 var proben = []; |
63 for (var i = 0; i < selection.length; i++) { | 85 for (var i = 0; i < selection.length; i++) { |