[Lada-commits] [PATCH] Add detail button to tables
Wald Commits
scm-commit at wald.intevation.org
Wed Dec 17 17:00:10 CET 2014
# HG changeset patch
# User Roland Geider <roland.geider at intevation.de>
# Date 1418831985 -3600
# Node ID 99e738c17b813bf6ec6c0b84af7c7449c84d5a19
# Parent 31a770c6a9a976cae6caccede7690049c343f4a9
Add detail button to tables
diff -r 31a770c6a9a9 -r 99e738c17b81 app/controller/Kommentare.js
--- 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);
},
diff -r 31a770c6a9a9 -r 99e738c17b81 app/controller/MKommentare.js
--- 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'));
diff -r 31a770c6a9a9 -r 99e738c17b81 app/controller/Messwert.js
--- 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'));
diff -r 31a770c6a9a9 -r 99e738c17b81 app/controller/Status.js
--- 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'));
diff -r 31a770c6a9a9 -r 99e738c17b81 app/controller/Zusatzwerte.js
--- 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);
},
diff -r 31a770c6a9a9 -r 99e738c17b81 app/view/kommentare/List.js
--- 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',
diff -r 31a770c6a9a9 -r 99e738c17b81 app/view/messwerte/List.js
--- 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',
diff -r 31a770c6a9a9 -r 99e738c17b81 app/view/mkommentare/List.js
--- 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',
diff -r 31a770c6a9a9 -r 99e738c17b81 app/view/status/List.js
--- 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',
diff -r 31a770c6a9a9 -r 99e738c17b81 app/view/zusatzwerte/List.js
--- 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',
More information about the Lada-commits
mailing list