質問

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.

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top