diff app/controller/Zusatzwerte.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 a12c9c97d3cb
children
line wrap: on
line diff
--- a/app/controller/Zusatzwerte.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/controller/Zusatzwerte.js	Wed Dec 17 16:59:45 2014 +0100
@@ -22,9 +22,9 @@
 
     addListeners: function() {
         this.control({
-            //'zusatzwertelist': {
-            //    itemdblclick: this.editItem
-            //},
+            'zusatzwertelist toolbar button[action=open]': {
+                click: this.editItem
+            },
             'zusatzwertelist 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 id = selection.getId();
+        var record = selection.store.getById(id);
+        
         record.getAuthInfo(this.initEditWindow);
     },
 

http://lada.wald.intevation.org