[Lada-commits] [PATCH 1 of 2] Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case

Wald Commits scm-commit at wald.intevation.org
Fri Mar 27 11:09:19 CET 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1427448022 -3600
# Node ID 0c8e689f3bcb60eabbfae888ec7deb8c4dc3bc7c
# Parent  f0bc5387abcc7a6d43278070371457e15fdde4ee
Added readonly to models, Probenzusatzwertgrid does now check wheter a record is readonly and disables the roweditor in such a case

diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/MKommentar.js
--- a/app/model/MKommentar.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/MKommentar.js	Fri Mar 27 10:20:22 2015 +0100
@@ -18,6 +18,10 @@
         name: 'owner',
         type: 'boolean'
     }, {
+        name: 'readonly',
+        type: 'boolean',
+        persist: false
+    }, {
         name: 'messungsId'
     }, {
         name: 'erzeuger'
diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/Messung.js
--- a/app/model/Messung.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/Messung.js	Fri Mar 27 10:20:22 2015 +0100
@@ -19,7 +19,8 @@
         type: 'boolean'
     }, {
         name: 'readonly',
-        type: 'boolean'
+        type: 'boolean',
+        persist: false
     }, {
         name: 'probeId'
     }, {
diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/Messwert.js
--- a/app/model/Messwert.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/Messwert.js	Fri Mar 27 10:20:22 2015 +0100
@@ -18,6 +18,10 @@
         name: 'owner',
         type: 'boolean'
     }, {
+        name: 'readonly',
+        type: 'boolean',
+        persist: false
+    }, {
         name: 'messungsId'
     }, {
         name: 'messgroesseId'
diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/Ort.js
--- a/app/model/Ort.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/Ort.js	Fri Mar 27 10:20:22 2015 +0100
@@ -18,6 +18,10 @@
         name: 'owner',
         type: 'boolean'
     }, {
+        name: 'readonly',
+        type: 'boolean',
+        persist: false
+    }, {
         name: 'ort'
     }, {
         name: 'probeId'
diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/PKommentar.js
--- a/app/model/PKommentar.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/PKommentar.js	Fri Mar 27 10:20:22 2015 +0100
@@ -18,6 +18,10 @@
         name: 'owner',
         type: 'boolean'
     }, {
+        name: 'readonly',
+        type: 'boolean',
+        persist: false
+    }, {
         name: 'probeId'
     }, {
         name: 'erzeuger'
diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/Probenzusatz.js
--- a/app/model/Probenzusatz.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/Probenzusatz.js	Fri Mar 27 10:20:22 2015 +0100
@@ -26,6 +26,10 @@
         name: 'owner',
         type: 'boolean'
     }, {
+        name: 'readonly',
+        type: 'boolean',
+        persist: false
+    }, {
         name: 'beschreibung'
     }, {
         name: 'mehId',
diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/Status.js
--- a/app/model/Status.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/Status.js	Fri Mar 27 10:20:22 2015 +0100
@@ -18,6 +18,10 @@
         name: 'owner',
         type: 'boolean'
     }, {
+        name: 'readonly',
+        type: 'boolean',
+        persist: false
+    }, {
         name: 'messungsId'
     }, {
         name: 'erzeuger'
diff -r f0bc5387abcc -r 0c8e689f3bcb app/model/Zusatzwert.js
--- a/app/model/Zusatzwert.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/model/Zusatzwert.js	Fri Mar 27 10:20:22 2015 +0100
@@ -18,6 +18,10 @@
         name: 'owner',
         type: 'boolean'
     }, {
+        name: 'readonly',
+        type: 'boolean',
+        persist: false
+    }, {
         name: 'probeId'
     }, {
         name: 'pzsId'
diff -r f0bc5387abcc -r 0c8e689f3bcb app/view/grid/Probenzusatzwert.js
--- a/app/view/grid/Probenzusatzwert.js	Fri Mar 27 09:38:13 2015 +0100
+++ b/app/view/grid/Probenzusatzwert.js	Fri Mar 27 10:20:22 2015 +0100
@@ -34,8 +34,11 @@
             listeners:{
                 // Make row ineditable when readonly is set to true
                 // Normally this would belong into a controller an not the view.
+                // But the RowEditPlugin is not handled there.
                 beforeedit: function(e, o) {
-                    if (o.record.get('readonly') == true) {
+                    var readonlywin = o.grid.up('window').record.get('readonly');
+                    var readonlygrid = o.record.get('readonly');
+                    if (readonlywin == true || readonlygrid == true)  {
                         return false;
                     }
                     return true;


More information about the Lada-commits mailing list