[Lada-commits] [PATCH 1 of 7] Only iterate over fields of the form is readonly. This increases the

Wald Commits scm-commit at wald.intevation.org
Wed Jul 17 12:16:37 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1374052007 -7200
# Node ID 08144d625b2bbe3148c9a923565487f7ae95ca4a
# Parent  d3f4a39bf89eecc3be923f57c3e571a301bf5d75
Only iterate over fields of the form is readonly. This increases the
performance.

diff -r d3f4a39bf89e -r 08144d625b2b app/view/widgets/LadaForm.js
--- a/app/view/widgets/LadaForm.js	Wed Jul 17 10:58:03 2013 +0200
+++ b/app/view/widgets/LadaForm.js	Wed Jul 17 11:06:47 2013 +0200
@@ -119,14 +119,16 @@
     },
     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);
+        if (bReadOnly) {
+            this.getForm().getFields().each (function (field) {
+                //field.setDisabled(bReadOnly);
+                field.setReadOnly(true);
+            });
+            /* 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) {


More information about the Lada-commits mailing list