diff app/view/grid/Messwert.js @ 1112:e76551a6da27

Use custom row expander in messung list grid.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 17 May 2016 17:12:33 +0200
parents 7e801af49eeb
children b73f9a976c82
line wrap: on
line diff
--- a/app/view/grid/Messwert.js	Tue May 17 17:12:07 2016 +0200
+++ b/app/view/grid/Messwert.js	Tue May 17 17:12:33 2016 +0200
@@ -30,6 +30,7 @@
     readOnly: true,
     allowDeselect: true,
     messgroesseStore: null,
+    bottomBar: true,
 
     initComponent: function() {
         this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
@@ -42,6 +43,12 @@
                 // Normally this would belong into a controller an not the view.
                 // But the RowEditPlugin is not handled there.
                 beforeedit: function(e, o) {
+                    // We are not in a messung window!
+                    if (!o.grid.up('window')) {
+                        return false;
+                    }
+                    // We are in a messung window and should check if we can
+                    // edit.
                     var readonlywin = o.grid.up('window').record.get('readonly');
                     var readonlygrid = o.record.get('readonly');
                     if (readonlywin == true || readonlygrid == true || this.disabled)  {
@@ -186,6 +193,9 @@
         this.initData();
         this.callParent(arguments);
         this.setReadOnly(true); //Grid is always initialised as RO
+        if (!me.bottomBar) {
+            this.down('toolbar[dock=bottom]').hide();
+        }
     },
 
     initData: function() {

http://lada.wald.intevation.org