diff app/controller/Kommentare.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 fbe81214026a
children
line wrap: on
line diff
--- a/app/controller/Kommentare.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/controller/Kommentare.js	Wed Dec 17 16:59:45 2014 +0100
@@ -30,9 +30,9 @@
 
     addListeners: function() {
         this.control({
-            //'kommentarelist': {
-            //    itemdblclick: this.editItem
-            //},
+            'kommentarelist toolbar button[action=open]': {
+                click: this.editItem
+            },
             'kommentarelist toolbar button[action=add]': {
                 click: this.addItem
             },
@@ -57,7 +57,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