[Lada-commits] [PATCH 2 of 4] Use 'owner' attribute to set messung grid and button RO status
Wald Commits
scm-commit at wald.intevation.org
Thu Feb 18 11:22:15 CET 2016
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1455790765 -3600
# Node ID e4b6b6c5fb898fc31feabd21e5800f31951f4333
# Parent fa04558f35cda822394e4ca8719abafaa725c3eb
Use 'owner' attribute to set messung grid and button RO status.
diff -r fa04558f35cd -r e4b6b6c5fb89 app/view/grid/Messung.js
--- a/app/view/grid/Messung.js Thu Feb 18 11:16:55 2016 +0100
+++ b/app/view/grid/Messung.js Thu Feb 18 11:19:25 2016 +0100
@@ -273,7 +273,9 @@
activateRemoveButton: function(selection, record) {
var grid = this;
//only enable the remove buttone, when the grid is editable.
- if (! grid.readOnly) {
+ if (! grid.readOnly &&
+ record.get('statusWert') === 0 &&
+ record.get('owner')) {
grid.down('button[action=delete]').enable();
}
},
diff -r fa04558f35cd -r e4b6b6c5fb89 app/view/window/ProbeEdit.js
--- a/app/view/window/ProbeEdit.js Thu Feb 18 11:16:55 2016 +0100
+++ b/app/view/window/ProbeEdit.js Thu Feb 18 11:19:25 2016 +0100
@@ -137,7 +137,8 @@
success: function(record, response) {
this.down('probeform').setRecord(record);
this.record = record;
- owner = this.record.get('owner');
+ var owner = this.record.get('owner');
+ var readonly = this.record.get('readonly');
if (owner) {
//Always allow to Add Messungen.
@@ -152,7 +153,7 @@
}
}
// If the Probe is ReadOnly, disable Inputfields and grids
- if (this.record.get('readonly') === true) {
+ if (readonly === true || !owner) {
this.down('probeform').setReadOnly(true);
this.disableChildren();
}
More information about the Lada-commits
mailing list