title: EXTJS assign function to variable and call it dynamically
body: <p>In my controller, I have the following ref and one function that I call after clicking a button. Is it possible to construct a ref method and then call it? I just want in a single function to handle many cases and I want to avoid if statements (as it is required in the project. It is supposed to be generic)</p>
  
  <p>The type will come as a parameter to the function.</p>
  
  <pre><code>     refs    : [{
          ref      : 'saleForm',
          selector : 'sale saleform'
       }],
  
           init: function () {    
              this.control({
                       'salesview #mybutton':{
                       click : this.onSaleClick 
                      }
              }); 
           },
  
      onSaleClick : function(){
  
         //this.getSaleForm().show();//works
  
         var type = "Sale";   
         var method = "get"+type+"Form()";    
         this.window = window;
         this.window[method]().show();        
     }
  </code></pre>