[Lada-commits] [PATCH 4 of 4] Added Icon-column to stammdaten grid showing RW-status
Wald Commits
scm-commit at wald.intevation.org
Wed Apr 13 18:42:01 CEST 2016
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1460565707 -7200
# Node ID 5e9a674d7bb465b034cd61dc266d1264b67049a9
# Parent 15d7b7a9e177530979d1e57a549a391e605d7e12
Added Icon-column to stammdaten grid showing RW-status.
diff -r 15d7b7a9e177 -r 5e9a674d7bb4 app/controller/grid/Datensatzerzeuger.js
--- 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();
},
diff -r 15d7b7a9e177 -r 5e9a674d7bb4 app/controller/grid/MessprogrammKategorie.js
--- 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();
},
diff -r 15d7b7a9e177 -r 5e9a674d7bb4 app/controller/grid/Probenehmer.js
--- 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();
},
diff -r 15d7b7a9e177 -r 5e9a674d7bb4 app/view/grid/DatensatzErzeuger.js
--- 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) {
diff -r 15d7b7a9e177 -r 5e9a674d7bb4 app/view/grid/MessprogrammKategorie.js
--- 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) {
diff -r 15d7b7a9e177 -r 5e9a674d7bb4 app/view/grid/Orte.js
--- 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'
}, {
diff -r 15d7b7a9e177 -r 5e9a674d7bb4 app/view/grid/Probenehmer.js
--- 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) {
More information about the Lada-commits
mailing list