title: Extjs 4 :Disable all the input elemets in an Extjs form at once
body: <p>I have created a extjs form which is divided into 2 parts using column layout and have almost 10-15 input elements in it. How can i disable all these input elements at a time depending on a condition. Currently i have created a function which fetchs all the components in a form and using ext.each loop through each element to disable them </p>
  
  <p>Here is the function that i use</p>
  
  <pre><code>function prepare_form_view(form){
      var f=Ext.getCmp(form);
      var els=f.query('component');
      Ext.each(els,function(o){
          var xtype=o.getXType();
          if(xtype=='textfield'||xtype=='combobox'||xtype=='datefield'||xtype=='textareafield'||xtype=='button'){
              o.disabledCls='myDisabledClass';
              o.disable();
          }
      });
  }
  </code></pre>
  
  <p>Is there any alternative way so that I can disable all elements without looping through each and every elements. <strong><em>I want to use this function with other forms too</em></strong>. I looking for something like 'setFieldDefult' function.</p>