How to call function synchronously

Hi Developers,
Can anyone help me to call function synchronously using sencha touch. Function should complete all the statement it contains.
Last updated:10/30/2014 2:00:53 AM

1 Answers

Sumit Kesarwani
Sumit Kesarwani

Hi Ravindra, 


Below is the sample code to call the function synchronously, just set false in async.

Ext.Ajax.request({
url: 'your page',
method: 'POST',
success: success,
failure: failure,
scope: this,
params: {foo: 'bar'},
async: false
});

// or directly ...
Ext.lib.Ajax.request('POST', url, callback, params, {async: false});

Answer