title: ExtJS 4 waiting for an AJAX request's results without using callback
body: <p>I am in a bit of a situation here and I need help. Here's an example of my code:</p>
  
  <pre><code>fn: function () {
      var test = this.ajaxFunction();
      alert(test);
  }
  
  ajaxFunction : function () {
      Ext.Ajax.request ({
          url: 'MyServlet',
          params: ...,
          success: function (response) {
              response = Ext.decode(response.responseText);
              return response.myVar;
          }
      });
  }
  </code></pre>
  
  <p>Obviously alert will give me an undefined result instead of the myVar value. How do I fix this? I know that AJAX in Ext is supported asynchronously and wherever I search everyone tells me to put my post-Ajax logic in the callback. However as you can see here that is not possible. I need BOTH functions fn and ajaxFunction. ajaxFunction gets called by many different functions so it needs to be separate.</p>
  
  <p>I have tried the "async" configuration but it doesn't seem to work. I think they have removed it (in ExtJS 4.2.1 at least).</p>
  
  <p>Any ideas?</p>