diff app/controller/Messwert.js @ 540:99e738c17b81

Add detail button to tables
author Roland Geider <roland.geider@intevation.de>
date Wed, 17 Dec 2014 16:59:45 +0100
parents 5960189e4461
children
line wrap: on
line diff
--- a/app/controller/Messwert.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/controller/Messwert.js	Wed Dec 17 16:59:45 2014 +0100
@@ -28,9 +28,9 @@
 
     addListeners: function() {
         this.control({
-            //'messwertelist': {
-            //    itemdblclick: this.editItem
-            //},
+            'messwertelist toolbar button[action=open]': {
+                click: this.editItem
+            },
             'messwertelist toolbar button[action=add]': {
                 click: this.addItem
             },
@@ -61,7 +61,12 @@
         });
     },
 
-    editItem: function(grid, record) {
+    editItem: function(button) {
+        var grid = button.up('grid');
+        var selection = grid.getView().getSelectionModel().getSelection()[0];
+        var messwertId = selection.getId();
+        var record = selection.store.getById(messwertId);
+        
         var mstore = Ext.data.StoreManager.get('Messungen');
         var messung = mstore.getById(record.get('messungsId'));
         record.getAuthInfo(this.initEditWindow, messung.get('probeId'));

http://lada.wald.intevation.org