changeset 522:de1acaf21db3

Add detail button for 'Orte' table See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Tue, 16 Dec 2014 15:58:43 +0100
parents 7a20e3054c9e
children 6ad453afbc31
files app/controller/Orte.js app/view/orte/List.js
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Orte.js	Tue Dec 16 14:50:30 2014 +0100
+++ b/app/controller/Orte.js	Tue Dec 16 15:58:43 2014 +0100
@@ -32,9 +32,9 @@
 
     addListeners: function() {
         this.control({
-            //'ortelist': {
-            //    itemdblclick: this.editItem
-            //},
+            'ortelist toolbar button[action=open]': {
+                click: this.editItem
+            },
             'ortelist toolbar button[action=add]': {
                 click: this.addItem
             },
@@ -145,7 +145,12 @@
         });
     },
 
-    editItem: function(grid, record) {
+    editItem: function(button) {
+        var grid = button.up('grid');
+        var selection = grid.getView().getSelectionModel().getSelection()[0];
+        var ortId = selection.getId();
+        var record = selection.store.getById(ortId);
+        
         record.getAuthInfo(this.initEditWindow);
     },
 
--- a/app/view/orte/List.js	Tue Dec 16 14:50:30 2014 +0100
+++ b/app/view/orte/List.js	Tue Dec 16 15:58:43 2014 +0100
@@ -38,6 +38,10 @@
             xtype: 'toolbar',
             dock: 'bottom',
             items: ['->', {
+                text: 'Details',
+                icon: 'gfx/document-open.png',
+                action: 'open'
+            }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
                 action: 'add',

http://lada.wald.intevation.org