[Lada-commits] [PATCH] check the correct grid to avoid editing

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


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1486132309 -3600
# Node ID 053bd0cd9744fe0775111bb7f9001ef52bc2df45
# Parent  cf73b7d7cf99104a1809b765b874d1ccf4451f58
check the correct grid to avoid editing.

diff -r cf73b7d7cf99 -r 053bd0cd9744 app/controller/Ort.js
--- a/app/controller/Ort.js	Fri Feb 03 15:31:18 2017 +0100
+++ b/app/controller/Ort.js	Fri Feb 03 15:31:49 2017 +0100
@@ -23,12 +23,12 @@
             'ortpanel ortstammdatengrid': {
                 edit: me.gridSave,
                 canceledit: me.cancelEdit,
-                select: me.select
+                select: me.selectPanel
             },
             'ortszuordnungwindow ortstammdatengrid': {
                 edit: me.gridSave,
                 canceledit: me.cancelEdit,
-                select: me.select
+                select: me.selectWindow
             },
             'ortpanel map': {
                 featureadded: me.featureadded
@@ -101,12 +101,27 @@
         grid.up('ortpanel').down('button[action=delete]').disable();
     },
 
-    select: function(rowModel, record) {
-        this.checkEdit(rowModel, record);
+    selectPanel: function(rowModel, record) {
+        this.checkEditPanel(rowModel, record);
         this.buttonToggle(rowModel, record);
     },
 
-    checkEdit: function(rowModel, record) {
+    selectWindow: function(rowModel, record) {
+        this.checkEditWindow(rowModel, record);
+        this.buttonToggle(rowModel, record);
+    },
+
+    checkEditWindow: function(rowModel, record) {
+        if (!Ext.Array.contains(Lada.netzbetreiber,
+            record.get('netzbetreiberId')) &&
+            record.get('netzbetreiberId') !== '') {
+            var grid = Ext.ComponentQuery.query('ortszuordnungwindow ortstammdatengrid')[0];
+            grid.rowEditing.cancelEdit();
+            return;
+        }
+    },
+
+    checkEditPanel: function(rowModel, record) {
         if (!Ext.Array.contains(Lada.netzbetreiber,
             record.get('netzbetreiberId')) &&
             record.get('netzbetreiberId') !== '') {


More information about the Lada-commits mailing list