Mercurial > lada > lada-client
changeset 1081:5e9a674d7bb4
Added Icon-column to stammdaten grid showing RW-status.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 13 Apr 2016 18:41:47 +0200 |
parents | 15d7b7a9e177 |
children | dbd435256f77 |
files | app/controller/grid/Datensatzerzeuger.js app/controller/grid/MessprogrammKategorie.js app/controller/grid/Probenehmer.js app/view/grid/DatensatzErzeuger.js app/view/grid/MessprogrammKategorie.js app/view/grid/Orte.js app/view/grid/Probenehmer.js |
diffstat | 7 files changed, 69 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/app/controller/grid/Datensatzerzeuger.js Wed Apr 13 16:10:25 2016 +0200 +++ b/app/controller/grid/Datensatzerzeuger.js Wed Apr 13 18:41:47 2016 +0200 @@ -48,13 +48,14 @@ } }, - edit: function() { + edit: function(gridView, record) { var grid = Ext.ComponentQuery.query('datensatzerzeugergrid')[0]; if (!Ext.Array.contains(Lada.netzbetreiber, record.get('netzbetreiberId'))) { grid.rowEditing.cancelEdit(); return; } + grid.rowEditing.startEdit(record, 0); grid.down('button[action=delete]').disable(); },
--- a/app/controller/grid/MessprogrammKategorie.js Wed Apr 13 16:10:25 2016 +0200 +++ b/app/controller/grid/MessprogrammKategorie.js Wed Apr 13 18:41:47 2016 +0200 @@ -48,13 +48,14 @@ } }, - edit: function() { + edit: function(rowModel, record) { var grid = Ext.ComponentQuery.query('messprogrammkategoriegrid')[0]; if (!Ext.Array.contains(Lada.netzbetreiber, record.get('netzbetreiberId'))) { grid.rowEditing.cancelEdit(); return; } + grid.rowEditing.startEdit(record, 0); grid.down('button[action=delete]').disable(); },
--- a/app/controller/grid/Probenehmer.js Wed Apr 13 16:10:25 2016 +0200 +++ b/app/controller/grid/Probenehmer.js Wed Apr 13 18:41:47 2016 +0200 @@ -55,6 +55,7 @@ grid.rowEditing.cancelEdit(); return; } + grid.rowEditing.startEdit(record, 0); grid.down('button[action=delete]').disable(); },
--- a/app/view/grid/DatensatzErzeuger.js Wed Apr 13 16:10:25 2016 +0200 +++ b/app/view/grid/DatensatzErzeuger.js Wed Apr 13 18:41:47 2016 +0200 @@ -63,6 +63,23 @@ }]; this.columns = [{ + xtype: 'actioncolumn', + text: 'RW', + dataIndex: 'readonly', + sortable: false, + width: 30, + getClass: function (val, meta, rec) { + console.log(rec.get('statusEdit')); + if (rec.get('readonly') === false) { + return 'edit'; + } + return 'noedit'; + }, + handler: function(grid, rowIndex, colIndex) { + var rec = grid.getStore().getAt(rowIndex); + grid.fireEvent('itemdblclick', grid, rec); + } + }, { header: i18n.getMsg('netzbetreiberId'), dataIndex: 'netzbetreiberId', renderer: function(value) {
--- a/app/view/grid/MessprogrammKategorie.js Wed Apr 13 16:10:25 2016 +0200 +++ b/app/view/grid/MessprogrammKategorie.js Wed Apr 13 18:41:47 2016 +0200 @@ -64,6 +64,23 @@ }]; this.columns = [{ + xtype: 'actioncolumn', + text: 'RW', + dataIndex: 'readonly', + sortable: false, + width: 30, + getClass: function (val, meta, rec) { + console.log(rec.get('statusEdit')); + if (rec.get('readonly') === false) { + return 'edit'; + } + return 'noedit'; + }, + handler: function(grid, rowIndex, colIndex) { + var rec = grid.getStore().getAt(rowIndex); + grid.fireEvent('itemdblclick', grid, rec); + } + }, { header: i18n.getMsg('netzbetreiberId'), dataIndex: 'netzbetreiberId', renderer: function(value) {
--- a/app/view/grid/Orte.js Wed Apr 13 16:10:25 2016 +0200 +++ b/app/view/grid/Orte.js Wed Apr 13 18:41:47 2016 +0200 @@ -43,6 +43,19 @@ } this.columns = [{ + xtype: 'actioncolumn', + text: 'RW', + dataIndex: 'readonly', + sortable: false, + width: 30, + getClass: function (val, meta, rec) { + console.log(rec.get('statusEdit')); + if (rec.get('readonly') === false) { + return 'edit'; + } + return 'noedit'; + } + }, { header: i18n.getMsg('orte.ortId'), dataIndex: 'ortId' }, {
--- a/app/view/grid/Probenehmer.js Wed Apr 13 16:10:25 2016 +0200 +++ b/app/view/grid/Probenehmer.js Wed Apr 13 18:41:47 2016 +0200 @@ -64,6 +64,23 @@ }] }]; this.columns = [{ + xtype: 'actioncolumn', + text: 'RW', + dataIndex: 'readonly', + sortable: false, + width: 30, + getClass: function (val, meta, rec) { + console.log(rec.get('statusEdit')); + if (rec.get('readonly') === false) { + return 'edit'; + } + return 'noedit'; + }, + handler: function(grid, rowIndex, colIndex) { + var rec = grid.getStore().getAt(rowIndex); + grid.fireEvent('itemdblclick', grid, rec); + } + }, { header: i18n.getMsg('netzbetreiberId'), dataIndex: 'netzbetreiberId', renderer: function(value) {