Home > DeveloperSection > Forums > How to call function synchronously
ravindra nalwaya
ravindra nalwaya

Total Post:4

Points:28
Posted on    October-30-2014 12:10 AM

 Sencha Touch Sencha Touch 
Ratings:


 1 Reply(s)
 1232  View(s)
Rate this:
Hi Developers,
Can anyone help me to call function synchronously using sencha touch. Function should complete all the statement it contains.


Sumit Kesarwani

Total Post:378

Points:2694
Posted on    October-30-2014 2:00 AM

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});

Don't want to miss updates? Please click the below button!

Follow MindStick