title: How to wait till AJAX request will complete in ExtJS
body: <p>I am calling AJAX request and getting the result as well but till that time next line of code start executing. I want to hold till AJAX success block executed. </p>
  
  <p>PFB the code snippet. </p>
  
  <pre><code>Ext.Ajax.request({
      url: PORTALURL.EXCEPTION.MAX_VALUE,
      success: function(response) {
          var maxValue = Ext.decode(response.responseText);
          if (grid.getSelectionModel().getSelection().length &gt; maxValue) {
              Ext.Msg.alert('Alert!', type + ' count is more than 10');
              return;
          }
      }
  });
  
  CommonUtil.alertConfirm(msg, function() {
  .. }
  </code></pre>
  
  <p>In above code. Before AJAX request complete and alert box pop up comes, <code>alertConfirm</code> gets called.</p>
  
  <p>Can anyone help in this.</p>