문제

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