comparison app/controller/Proben.js @ 255:82118c01bc52

#57: Open Edit-Dialog after creating a new Probe.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 24 Jul 2013 19:14:02 +0200
parents 237a4efe715a
children d8993f5b96e8
comparison
equal deleted inserted replaced
254:c2effc4a497b 255:82118c01bc52
72 probeId: id 72 probeId: id
73 } 73 }
74 }); 74 });
75 console.log("Loaded Probe with ID " + record.getId()); //outputs ID 75 console.log("Loaded Probe with ID " + record.getId()); //outputs ID
76 }, 76 },
77 createSuccess: function(form, record, operation) { 77 createSuccess: function(form, record, response) {
78 // Reload store 78 // Reload store
79 var store = this.getProbenStore(); 79 //var store = this.getProbenStore();
80 store.reload(); 80 //store.reload();
81 var win = form.up('window'); 81 var win = form.up('window');
82 win.close(); 82 win.close();
83 // Open Editdialog
84 var json = Ext.decode(response.responseText);
85 if (json) {
86 var probeId = json.data.probeId;
87 record.set('probeId', probeId);
88 }
89 this.editProbe(null, record);
83 }, 90 },
84 createFailure: function(form, record, operation) { 91 createFailure: function(form, record, response) {
85 Ext.MessageBox.show({ 92 Ext.MessageBox.show({
86 title: 'Fehler beim Speichern', 93 title: 'Fehler beim Speichern',
87 msg: form.message, 94 msg: form.message,
88 icon: Ext.MessageBox.ERROR, 95 icon: Ext.MessageBox.ERROR,
89 buttons: Ext.Msg.OK 96 buttons: Ext.Msg.OK
90 }); 97 });
91 }, 98 },
92 editSuccess: function(form, record, operation) { 99 editSuccess: function(form, record, response) {
93 // Reload store 100 // Reload store
94 var store = this.getProbenStore(); 101 var store = this.getProbenStore();
95 store.reload(); 102 store.reload();
96 var win = form.up('window'); 103 var win = form.up('window');
97 win.close(); 104 win.close();
98 }, 105 },
99 editFailure: function(form, record, operation) { 106 editFailure: function(form, record, response) {
100 Ext.MessageBox.show({ 107 Ext.MessageBox.show({
101 title: 'Fehler beim Speichern', 108 title: 'Fehler beim Speichern',
102 msg: form.message, 109 msg: form.message,
103 icon: Ext.MessageBox.ERROR, 110 icon: Ext.MessageBox.ERROR,
104 buttons: Ext.Msg.OK 111 buttons: Ext.Msg.OK

http://lada.wald.intevation.org