comparison app/controller/grid/Messung.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 cc9107d9be17
children 2362f8ab1e9f
comparison
equal deleted inserted replaced
740:2e8da590ea0c 742:6e28ebbe1a73
14 14
15 requires: [ 15 requires: [
16 'Lada.view.window.MessungEdit' 16 'Lada.view.window.MessungEdit'
17 ], 17 ],
18 18
19 /**
20 * Inhitialize the controller
21 * It has 3 listeners
22 */
19 init: function() { 23 init: function() {
20 this.control({ 24 this.control({
21 'messunggrid': { 25 'messunggrid': {
22 itemdblclick: this.editItem 26 itemdblclick: this.editItem
23 }, 27 },
28 click: this.remove 32 click: this.remove
29 } 33 }
30 }); 34 });
31 }, 35 },
32 36
37 /**
38 * This function opens a new {@link Lada.view.window.MessungEdit}
39 * Window.
40 */
33 editItem: function(grid, record) { 41 editItem: function(grid, record) {
34 var probe = grid.up('window').record; 42 var probe = grid.up('window').record;
35 var win = Ext.create('Lada.view.window.MessungEdit', { 43 var win = Ext.create('Lada.view.window.MessungEdit', {
36 parentWindow: grid.up('window'), 44 parentWindow: grid.up('window'),
37 probe: probe, 45 probe: probe,
40 }); 48 });
41 win.show(); 49 win.show();
42 win.initData(); 50 win.initData();
43 }, 51 },
44 52
53 /**
54 * This function opens a window add a Messung
55 */
45 add: function(button) { 56 add: function(button) {
46 var probe = button.up('window').record; 57 var probe = button.up('window').record;
47 var win = Ext.create('Lada.view.window.MessungCreate', { 58 var win = Ext.create('Lada.view.window.MessungCreate', {
48 record: probe, 59 record: probe,
49 grid: button.up('messunggrid') 60 grid: button.up('messunggrid')
50 }); 61 });
51 win.show(); 62 win.show();
52 win.initData(); 63 win.initData();
53 }, 64 },
54 65
66 /**
67 * This function removes a Messung
68 * It displays a Confirmation-Popup.
69 * When the Removal was confirmed and the operation was successful,
70 * the Messung-row is removed from the grid.
71 * On failure an Errormessage is shown
72 */
55 remove: function(button) { 73 remove: function(button) {
56 var grid = button.up('grid'); 74 var grid = button.up('grid');
57 var selection = grid.getView().getSelectionModel().getSelection()[0]; 75 var selection = grid.getView().getSelectionModel().getSelection()[0];
58 Ext.MessageBox.confirm( 76 Ext.MessageBox.confirm(
59 'Messung löschen', 77 'Messung löschen',

http://lada.wald.intevation.org