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
Extjs Sencha Touch 2.0进度指示器_Extjs_Sencha Touch 2_Sencha Touch 2.1 - Fatal编程技术网

Extjs Sencha Touch 2.0进度指示器

Extjs Sencha Touch 2.0进度指示器,extjs,sencha-touch-2,sencha-touch-2.1,Extjs,Sencha Touch 2,Sencha Touch 2.1,我必须使用Sencha touch 2.x在不同的ajax请求中添加完成百分比的进度指示器,例如,如果我有2个ajax请求,则在成功响应服务器后,每个请求的进度指示器将显示50%的完成百分比 下面是另一种不用progressIndicator的解决方法: Ext.application({ 名字:“小提琴”, 启动:函数(){ var progressIndicator=Ext.create('Ext.Panel'{ html:'+ ''+ ''+ ''+ '', 对,, 莫代尔:是的, hi

我必须使用Sencha touch 2.x在不同的ajax请求中添加完成百分比的进度指示器,例如,如果我有2个ajax请求,则在成功响应服务器后,每个请求的进度指示器将显示50%的完成百分比

下面是另一种不用progressIndicator的解决方法:

Ext.application({
名字:“小提琴”,
启动:函数(){
var progressIndicator=Ext.create('Ext.Panel'{
html:'+
''+
''+
''+
'',
对,,
莫代尔:是的,
hideOnMaskTap:没错,
宽度:“50%”,
高度:'80',
});
var进度=1;
//progressIndicator.updateBar();
Ext.Viewport.add(progressIndicator);
progressIndicator.show();
var intervalProgress=setInterval(函数(){
//控制台日志(进度);
进度+=1;
document.getElementById(“开始”).style.width=(进度)+'%';
//progressIndicator.setProgress(进度);
//progressIndicator.updateBar();
如果(进度>=100){
clearInterval(间隔进度)
}
},100)
}
});

同时的Ajax请求?事实上,对于不同的任务,我有2个或更多不同的Ajax请求,所以每次成功完成后,我都想给用户响应,任务1已经完成,希望现在更清楚了,希望在sencha touch中使用进度指示器或sencha 2.0中的其他工具来解决这个问题,而在sencha 2.0中没有
ProgressIndicator
谢谢,这会很有帮助
Ext.application({
    name : 'Fiddle',

    launch : function() {


        var progressIndicator = Ext.create('Ext.Panel', {
            html: '<table  style="height:30px; width:100%">'+
                  '<tr>'+
                  '<td id="start" style="background-color:green;width:1%"></td>'+
                  '<td id="end"></td>'+
                  '</tr></table>',
            centered : true,
            modal    : true,
            hideOnMaskTap : true,
            width    : '50%',
            height   : '80',
         });

        var progress = 1;

        //progressIndicator.updateBar();
        Ext.Viewport.add(progressIndicator);
        progressIndicator.show();


        var intervalProgress=setInterval(function(){
            //console.log(progress);
            progress+=1;

            document.getElementById("start").style.width = (progress) +'%';
            //progressIndicator.setProgress(progress);
            //progressIndicator.updateBar();
            if(progress >= 100){
                clearInterval(intervalProgress)
            }
        },100)
    }
});