comparison app/controller/Proben.js @ 70:1a943947a7d2

Added new listeners for events comming from the Probenforms.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 05 Jun 2013 15:43:42 +0200
parents cb1138f5cea7
children db26aeebe521
comparison
equal deleted inserted replaced
69:cb1138f5cea7 70:1a943947a7d2
25 itemdblclick: this.editProbe 25 itemdblclick: this.editProbe
26 }, 26 },
27 'probenlist toolbar button[action=add]': { 27 'probenlist toolbar button[action=add]': {
28 click: this.addProbe 28 click: this.addProbe
29 }, 29 },
30 'probencreate form': {
31 savesuccess: this.createSuccess,
32 savefailure: this.createFailure
33 },
34 'probenedit form': {
35 savesuccess: this.editSuccess,
36 savefailure: this.editFailure
30 } 37 }
31 }); 38 });
32 }, 39 },
33 addProbe: function(button) { 40 addProbe: function(button) {
34 console.log('Adding new Probe'); 41 console.log('Adding new Probe 1');
35 var view = Ext.widget('probencreate'); 42 var view = Ext.widget('probencreate');
36 }, 43 },
37 editProbe: function(grid, record) { 44 editProbe: function(grid, record) {
38 console.log('Double click on ' + record.get('probeId')); 45 console.log('Double click on ' + record.get('probeId'));
39 // Create new window to edit the seletced record. 46 // Create new window to edit the seletced record.
54 console.log("Loaded probe with ID " + record.getId()); //outputs ID 61 console.log("Loaded probe with ID " + record.getId()); //outputs ID
55 }, 62 },
56 createSuccess: function(form, record, operation) { 63 createSuccess: function(form, record, operation) {
57 var win = form.up('window'); 64 var win = form.up('window');
58 win.close(); 65 win.close();
66 },
67 createFailure: function(form, record, operation) {
68 Ext.MessageBox.show({
69 title: 'Fehler beim Speichern',
70 msg: 'Es gab Fehler beim Anlegen der Probe',
71 icon: Ext.MessageBox.ERROR,
72 buttons: Ext.Msg.OK
73 });
74 },
75 editSuccess: function(form, record, operation) {
76 var win = form.up('window');
77 win.close();
78 },
79 editFailure: function(form, record, operation) {
80 Ext.MessageBox.show({
81 title: 'Fehler beim Speichern',
82 msg: 'Es gab Fehler beim Speichern der Probe',
83 icon: Ext.MessageBox.ERROR,
84 buttons: Ext.Msg.OK
85 });
59 } 86 }
60 }); 87 });

http://lada.wald.intevation.org