extjs - Sencha Touch 2.0 进度指示器
问题描述
我必须使用 Sencha touch 2.x 在不同的 ajax 请求中添加完成百分比的进度指示器,例如,如果我有 2 个 Ajax 请求进度指示器将在服务器响应成功后在每个请求上显示 50% 完成。
解决方案
这是另一种在没有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)
}
});
推荐阅读
- javascript - 使用 YouTube API 检查视频是否可嵌入
- ssl - SSL 中间 CA 用于创建和签署客户端证书
- python - Python_在一行中接受多个不同数据类型的输入
- python - 如何在python中使用相同变量的所有90个值制作一个txt文件
- java - 如何在 Andriod 中获取另一个类的字符串值?
- ruby-on-rails - 如何在 Rails 中创建具有 many_to_many 关系的单独模型的嵌套形式?
- cakephp - 如何在 cakePHP2 中设置 csrfExpires 时间?
- sql - 如何使用 Union 将数据插入到表中
- javascript - 在 vue 中一次设置一个订单项“活动”
- azure-devops - 从 $(Build.SourceVersion) 中提取主要和次要