Reputation: 8995
I'm using
Ext.getCmp('my_form').submit(
{
url: 'http://does-not-respond.onion/',
method : 'POST',
waitMsg : 'Please wait...',
timeout: 5,
params :
{
The "Please wait" window doesn't disappear. How I can make it disappear and alert a message? I want it to disappear and show error message if the server does not respond, like the internets has gone away.
Upvotes: 0
Views: 6622
Reputation: 2216
try checking the failureType
on form action's failure
Ext.getCmp('my_form').submit({
url : 'http://does-not-respond.onion/',
method : 'POST',
waitMsg : 'Please Wait...',
timeout : 5,
params : {},
success : function(){console.log('success...');},
failure: function(form, action){
if (action.failureType === Ext.form.action.Action.CONNECT_FAILURE) {
Ext.Msg.alert('Error',
'Status:'+action.response.status+': '+
action.response.statusText);
}
}
});
refer Ext.form.action.Action-property-failureType
Upvotes: 1