diff app/controller/MKommentare.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 8972f008dfb1
children
line wrap: on
line diff
--- a/app/controller/MKommentare.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/controller/MKommentare.js	Wed Dec 17 16:59:45 2014 +0100
@@ -30,9 +30,9 @@
 
     addListeners: function() {
         this.control({
-            //'mkommentarelist': {
-            //    itemdblclick: this.editItem
-            //},
+            'mkommentarelist toolbar button[action=open]': {
+                click: this.editItem
+            },
             'mkommentarelist toolbar button[action=add]': {
                 click: this.addItem
             },
@@ -58,7 +58,12 @@
         });
     },
 
-    editItem: function(grid, record) {
+    editItem: function(button) {
+        var grid = button.up('grid');
+        var selection = grid.getView().getSelectionModel().getSelection()[0];
+        var commentarId = selection.getId();
+        var record = selection.store.getById(commentarId);
+        
         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