diff app/view/grid/MessprogrammKategorie.js @ 1039:77e22ad5cc84

Use user 'funktionen' attribute to set read/write status for stammdaten.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 19 Feb 2016 13:59:24 +0100
parents 15d8c64049d1
children d859fbfc8a53
line wrap: on
line diff
--- a/app/view/grid/MessprogrammKategorie.js	Fri Feb 19 13:58:43 2016 +0100
+++ b/app/view/grid/MessprogrammKategorie.js	Fri Feb 19 13:59:24 2016 +0100
@@ -30,13 +30,15 @@
         var i18n = Lada.getApplication().bundle;
         this.emptyText = i18n.getMsg('mk.emptyGrid');
 
-        this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
-            clicksToMoveEditor: 1,
-            autoCancel: false,
-            disabled: false,
-            pluginId: 'rowedit'
-        });
-        this.plugins = [this.rowEditing];
+        if (Ext.Array.contains(Lada.funktionen, 4)) {
+            this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
+                clicksToMoveEditor: 1,
+                autoCancel: false,
+                disabled: false,
+                pluginId: 'rowedit'
+            });
+            this.plugins = [this.rowEditing];
+        }
 
         // TODO: Which docked Items are required?
         this.dockedItems = [{
@@ -115,8 +117,11 @@
     /**
      * This sets the Store of this Grid
      */
-    setStore: function(store){
+    setStore: function(store) {
         var i18n = Lada.getApplication().bundle;
+        if (Ext.Array.contains(Lada.funktionen, 4)) {
+            this.down('button[action=add]').enable();
+        }
 
         this.removeDocked(Ext.getCmp('ptbar'), true);
         this.reconfigure(store);

http://lada.wald.intevation.org