changeset 221:cf83b382dc02

setReadOnly now also iterates over the toolbars within the form and hide them if the form is marked as readonly
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 16 Jul 2013 09:59:25 +0200
parents 8e41a5a6cb7f
children bd9ee11c74b4
files app/view/widgets/LadaForm.js
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/widgets/LadaForm.js	Mon Jul 15 17:51:28 2013 +0200
+++ b/app/view/widgets/LadaForm.js	Tue Jul 16 09:59:25 2013 +0200
@@ -118,10 +118,16 @@
         return translated;
     },
     setReadOnly: function (bReadOnly) {
+        /* Iterate over all fields and set them readonly */
         this.getForm().getFields().each (function (field) {
             //field.setDisabled(bReadOnly);
             field.setReadOnly(bReadOnly);
         });
+        /* Iterate over all toolbars of lists and hide them */
+        var childs = this.query('toolbar');
+        for (var i = childs.length - 1; i >= 0; i--){
+            childs[i].setVisible(false);
+        }
     },
     parseResponse: function(response) {
         var json = Ext.decode(response.responseText);

http://lada.wald.intevation.org