title: Extjs Load Mask while long processing
body: <p>I have problems setting load mask on panel properly. After click on a button the new tree store is being generated (localy) and it takes quite some time. The load mask shows for a millisecond only after (i think) the whole function evaluates. In my code <code>console.log(0)</code> and <code>console.log(1)</code> shows after the whole function processes, the button alone freezes for couple of seconds then unfreezes and after that console shows <code>0 and 1</code>. What is the proper way to handle this kind of situations. Here is the code:</p>
  
  <p>Button definition:</p>
  
  <pre><code>
  
      xtype:'button',
      text:'Rozdziel działki',
      iconCls:'icon-map_link',
      scope:this,
      handler:function(){
         console.log(0);
         this.splitParcels();
      }
  
  </code></pre>
  
  <p>Split Parcels function:-</p>
  
  <pre>
  
      splitParcels:function(){
      var mask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
          mask.show();
          console.log(1);
  
          this.mgstore.getRootNode().removeAll();
  
          console.log(this.response);
          var root_node = this.mgstore.getRootNode();
          Ext.each(this.response.plans, function(plan){
              var plan_obj = {
                      id:plan.plan.id,
                      text:plan.plan.abbreviation,
                      gsip_plan:plan,
                      gsip_type:'plan',
                      iconCls:'icon-map',
                      expanded:true,
                      leaf:false
              };
  
              Ext.each(plan.parcels, function(parcel){
                  var parcel_obj = {
                          id:parcel.parcel.id,
                          text:parcel.parcel.name,
                          leaf:true,
                          gsip_plan:plan,
                          gsip_parcels:parcel,
                          gsip_type:'parcel',
                          iconCls:'icon-vector'
                  };
  
                  var planNode = root_node.appendChild(plan_obj);
                  planNode.appendChild(parcel_obj);
              });
          });
  
          if (mask != undefined) mask.hide();
  }
  </pre>