changeset 1342:d5e270fa91e4

fix: Ortserstellung for Staaten and validity check triggers
author Maximilian Krambach <mkrambach@intevation.de>
date Mon, 06 Feb 2017 09:59:03 +0100
parents 2e8eba3918b1
children cd16b30dbc10
files app/controller/form/Ortserstellung.js app/controller/grid/Ortszuordnung.js
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/form/Ortserstellung.js	Fri Feb 03 21:43:52 2017 +0100
+++ b/app/controller/form/Ortserstellung.js	Mon Feb 06 09:59:03 2017 +0100
@@ -23,13 +23,13 @@
             'ortserstellungsform button[action=revert]': {
                 click: this.discard
             },
-            'ortserstellungsform staat' : {
+            'ortserstellungsform staat combobox' : {
                 change: this.checkCommitEnabled
             },
-            'ortserstellungsform verwaltungseinheit' : {
+            'ortserstellungsform verwaltungseinheit combobox' : {
                 change: this.checkCommitEnabled
             },
-            'ortserstellungsform koordinatenart': {
+            'ortserstellungsform koordinatenart combobox': {
                 change: this.checkCommitEnabled
             },
             'ortserstellungsform numfield [name=koordXExtern]': {
@@ -61,7 +61,7 @@
                 button.setDisabled(true);
                 me.down('button[action=revert]').setDisabled(true);
                 button.hide();
-                var ozw = me.up().parentWindow;
+                var ozw = me.up('window').parentWindow;
                 var json = Ext.decode(response.response.responseText);
                 if (json) {
                     me.clearMessages();
@@ -150,8 +150,8 @@
                     && form.findField('koordYExtern').getValue()
                     && form.findField('koordXExtern').getValue()
                 )
-                || form.findField('gemId').getValue() >= 0
-                || form.findField('staatId').getValue() >= 0
+                || form.findField('gemId').getValue() !== null
+                || form.findField('staatId').getValue() !== null
                 ) {
                 savebutton.setDisabled(false);
             } else {
--- a/app/controller/grid/Ortszuordnung.js	Fri Feb 03 21:43:52 2017 +0100
+++ b/app/controller/grid/Ortszuordnung.js	Mon Feb 06 09:59:03 2017 +0100
@@ -319,6 +319,7 @@
 
     selectedStaat: function(grid, record) {
         var win = grid.up('window');
+        var panel = this.searchField.up('panel').up('window');
         win.hide();
         this.searchField.reset();
         Ext.create('Lada.view.window.Ortserstellung', {
@@ -330,7 +331,7 @@
                 berichtstext: record.get('staat'),
                 ortTyp: 5
             }),
-            parentWindow: win
+            parentWindow: panel
         }).show();
     }
 });

http://lada.wald.intevation.org