[Lada-commits] [PATCH] setReadOnly now also iterates over the toolbars within the form and hide them

Wald Commits scm-commit at wald.intevation.org
Tue Jul 16 10:49:01 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1373961565 -7200
# Node ID cf83b382dc0236777897a5fae52b9b69404147ca
# Parent  8e41a5a6cb7f3f9712329036897e7fe473a5ec24
setReadOnly now also iterates over the toolbars within the form and hide them
if the form is marked as readonly

diff -r 8e41a5a6cb7f -r cf83b382dc02 app/view/widgets/LadaForm.js
--- 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);


More information about the Lada-commits mailing list