PDA

View Full Version : Suspend action during ajax request



iLoLo21
19 Mar 2009, 2:56 AM
Hello

I would suspend my script until my ajax request return result.

How can I dow this ? With requestcomplete event ?



Ext.Ajax.request({
url : action,
failure : function(result, request) {
alert('error');
},
success : function(result, request) {
alert('ok');
}
});


thanks

jsakalos
19 Mar 2009, 2:57 AM
You cannot suspend it. Issue the request and provide a callback (or success and failure) function to execute your code when response is back.

iLoLo21
19 Mar 2009, 8:50 AM
a callback function ?

Have you a sample ?

Thank a lot

jsakalos
19 Mar 2009, 10:52 AM
http://extjs.com/deploy/dev/docs/?class=Ext.data.Connection&member=request
http://examples.extjs.eu