diff app/controller/Ort.js @ 1050:e0b5e64928c9 stammdatengrids

Use rowediting plugin for orte grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 01 Mar 2016 13:16:10 +0100
parents 1bd4c0709bd6
children 981339d774b8
line wrap: on
line diff
--- a/app/controller/Ort.js	Tue Mar 01 11:50:39 2016 +0100
+++ b/app/controller/Ort.js	Tue Mar 01 13:16:10 2016 +0100
@@ -103,17 +103,20 @@
      * Enables/Disables a set of buttons
      **/
     buttonToggle: function(enabled, panel) {
-        if (!enabled) {
+        if (!enabled &&
+            panel.down('button[action=delete]')) {
             panel.down('button[action=delete]').disable();
         }
         else {
-            if (!panel.down('ortstammdatengrid').getPlugin('rowedit').editing) {
+            if (panel.down('ortstammdatengrid').getPlugin('rowedit') &&
+                !panel.down('ortstammdatengrid').getPlugin('rowedit').editing &&
+                panel.down('button[action=delete]')) {
             //only enable buttons, when grid is not beeing edited
                 panel.down('button[action=delete]').enable();
             }
             //else turn them off again!
             else {
-                this.buttonToggle(false, panel);
+                panel.down('button[action=delete]').disable();
             }
         }
     }

http://lada.wald.intevation.org