changeset 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 a73726bba79c
children 566976d72ce5
files app/controller/Filter.js app/view/grid/MessungList.js app/view/grid/Messwert.js
diffstat 3 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Filter.js	Tue May 17 17:12:07 2016 +0200
+++ b/app/controller/Filter.js	Tue May 17 17:12:33 2016 +0200
@@ -138,7 +138,15 @@
                     break;
                 case 'messung':
                     gridstore = Ext.create('Lada.store.MessungenList');
-                    frgrid = Ext.create('Lada.view.grid.MessungList');
+                    frgrid = Ext.create('Lada.view.grid.MessungList', {
+                        plugins: [{
+                            ptype: 'gridrowexpander',
+                            gridType: 'Lada.view.grid.Messwert',
+                            gridConfig: {
+                                bottomBar: false
+                            }
+                        }]
+                    });
                     break;
                 case 'messprogramm':
                     gridstore = Ext.create('Lada.store.MessprogrammeList');
--- a/app/view/grid/MessungList.js	Tue May 17 17:12:07 2016 +0200
+++ b/app/view/grid/MessungList.js	Tue May 17 17:12:33 2016 +0200
@@ -17,7 +17,8 @@
         var i18n = Lada.getApplication().bundle;
         this.emptyText = i18n.getMsg('messung.emptyGrid');
         this.selModel = Ext.create('Ext.selection.CheckboxModel', {
-            checkOnly: true
+            checkOnly: true,
+            injectCheckbox: 1
         });
 
         this.dockedItems = [{
--- 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