[Lada-commits] [PATCH 4 of 4] merged

Wald Commits scm-commit at wald.intevation.org
Fri Feb 3 14:32:35 CET 2017


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1486128748 -3600
# Node ID 754db8d7369164baa8e7d9b1d10fd55b849bc853
# Parent  6edab3ee2198ce9643553ceb6669c7ddd7928082
# Parent  518b4c28e71a2809a78c6ada29a16ff0705f3302
merged

diff -r 6edab3ee2198 -r 754db8d73691 app/view/form/Ortserstellung.js
--- a/app/view/form/Ortserstellung.js	Fri Feb 03 14:32:12 2017 +0100
+++ b/app/view/form/Ortserstellung.js	Fri Feb 03 14:32:28 2017 +0100
@@ -274,17 +274,25 @@
 
     saveOrt: function() {
         var this_panel = this.up('panel');
+        var me = this;
         var form = this_panel.getForm();
         var record = form.getRecord();
-        var oldId = record.get('ortId');
         var data = form.getFieldValues(true);
         for (var key in data) {
             record.set(key, data[key]);
         }
+        record.set('id', null);
         record.set('netzbetreiberId', Lada.netzbetreiber[0]);
         record.save({
             success: function(newrecord, response) {
                 form.loadRecord(newrecord);
+                this_panel.down('verwaltungseinheit').store.load(
+                        { id:newrecord.get('gemId') });
+                console.log(this_panel.down('verwaltungseinheit'));
+                this_panel.down('staat').store.load(
+                        { id : newrecord.get('staat') });
+                me.setDisabled(true);
+                me.hide();
                 var ozw = this_panel.up().parentWindow;
                 var json = Ext.decode(response.response.responseText);
                 if (json) {
@@ -306,11 +314,7 @@
                                 resulttext = 'Dieser Ort existiert bereits!';
                             }
                             if (json.message == '200') {
-                                if (oldId === undefined) {
-                                    resulttext = 'Ort erfolgreich angelegt!';
-                                } else {
-                                    resulttext = 'Bestehender Ort erfolgreich modifiziert!';
-                                }
+                                resulttext = 'Ort erfolgreich angelegt!';
                             }
                         }
                         Ext.Msg.show({
@@ -342,6 +346,7 @@
                     Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
                         Lada.getApplication().bundle.getMsg('err.msg.response.body'));
                 }
+                me.setDisabled(true);
             }
         });
     },


More information about the Lada-commits mailing list