changeset 540:99e738c17b81

Add detail button to tables
author Roland Geider <roland.geider@intevation.de>
date Wed, 17 Dec 2014 16:59:45 +0100
parents 31a770c6a9a9
children 6a5b48b17542
files app/controller/Kommentare.js app/controller/MKommentare.js app/controller/Messwert.js app/controller/Status.js app/controller/Zusatzwerte.js app/view/kommentare/List.js app/view/messwerte/List.js app/view/mkommentare/List.js app/view/status/List.js app/view/zusatzwerte/List.js
diffstat 10 files changed, 65 insertions(+), 20 deletions(-) [+]
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);
     },
 
--- 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'));
--- 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'));
--- a/app/controller/Status.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/controller/Status.js	Wed Dec 17 16:59:45 2014 +0100
@@ -23,9 +23,9 @@
 
     addListeners: function() {
         this.control({
-            //'statuslist': {
-            //    itemdblclick: this.editItem
-            //},
+            'statuslist toolbar button[action=open]': {
+                click: this.editItem
+            },
             'statuslist toolbar button[action=add]': {
                 click: this.addItem
             },
@@ -55,7 +55,12 @@
         });
     },
 
-    editItem: function(grid, record) {
+    editItem: function(button) {
+        var grid = button.up('grid');
+        var selection = grid.getView().getSelectionModel().getSelection()[0];
+        var statusId = selection.getId();
+        var record = selection.store.getById(statusId);
+        
         var mstore = Ext.data.StoreManager.get('Messungen');
         var messung = mstore.getById(record.get('messungsId'));
         record.getAuthInfo(this.initEditWindow, messung.get('probeId'));
--- 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);
     },
 
--- a/app/view/kommentare/List.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/view/kommentare/List.js	Wed Dec 17 16:59:45 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',
--- a/app/view/messwerte/List.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/view/messwerte/List.js	Wed Dec 17 16:59:45 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',
--- a/app/view/mkommentare/List.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/view/mkommentare/List.js	Wed Dec 17 16:59:45 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',
--- a/app/view/status/List.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/view/status/List.js	Wed Dec 17 16:59:45 2014 +0100
@@ -36,6 +36,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',
--- a/app/view/zusatzwerte/List.js	Wed Dec 17 15:42:55 2014 +0100
+++ b/app/view/zusatzwerte/List.js	Wed Dec 17 16:59:45 2014 +0100
@@ -35,6 +35,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