Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在SenchaTouch中发送ajax请求时显示进度条?_Ajax_Extjs_Sencha Touch 2.1 - Fatal编程技术网

如何在SenchaTouch中发送ajax请求时显示进度条?

如何在SenchaTouch中发送ajax请求时显示进度条?,ajax,extjs,sencha-touch-2.1,Ajax,Extjs,Sencha Touch 2.1,在Sencha Touch应用程序中,我提出了一个Ajax请求。我想在处理请求时显示一个进度条,它将超时设置为60秒。如果连接超时,那么我想显示消息“连接很慢”。怎么做?下面是Ajax请求的代码 $.ajax( { type : "GET", async : false, dataType : "text",

在Sencha Touch应用程序中,我提出了一个Ajax请求。我想在处理请求时显示一个进度条,它将超时设置为60秒。如果连接超时,那么我想显示消息“连接很慢”。怎么做?下面是Ajax请求的代码

  $.ajax(
               {
                     type : "GET",
                     async : false,
                     dataType : "text",
                     url : 'someurl',
                     success : function(data1)
                     {


                     }
          });
如何修改代码以添加上述功能???

如何

var basePanel = 
Ext.ComponentQuery.query("toppanel")[0];
var loginFormPanel = 
Ext.ComponentQuery.query("loginformpanel")[0];

var task = Ext.create('Ext.util.DelayedTask', function() {
Ext.Viewport.mask({ xtype: 'loadmask',
                   message: "Checking Credentials.." });
}, this);

task.delay(500);

// do login and if success, 
//   flip, otherwise show error
Ext.Ajax.request({
url:'/rpc/Account/Login', 
params: {
    Username: loginFormPanel.getValues().username,
    Password: loginFormPanel.getValues().password,
    RememberMe: loginFormPanel.getValues().rememberMe != null
},
success: function(response){
    task.cancel(); 
    Ext.Viewport.unmask(); 
    basePanel.animateActiveItem(1,{type: 'flip' });
},
failure: function() {
    task.cancel(); 
    Ext.Viewport.unmask(); 
    Ext.Msg.alert("Login Failed");
}
});