ExtJs学习之路--进度条
有图有真相,先看效果图片
代码如下:
1 var progressBar = Ext.Msg.show({
2 title : "请稍等...",
3 msg : "服务器正在处理中...",
4 progress : true,
5 width : 300
6 });
7 var count = 0;
8 var bartext = "";
9 var curnum = 0;
10 var task = {
11 run : function() {
12 count++;
13 if (flag != "保存中") {
14 progressBar.hide();
15 Ext.TaskMgr.stop(task);
16 }
17 if (count < 10) {
18 curnum = count / 10;
19 bartext = curnum * 100 + "%";
20 } else {
21 curnum = 9.9;
22 bartext = 99 + "%";
23 }
24 progressBar.updateProgress(curnum, bartext);
25 },
26 interval : 500
27 }
28 Ext.TaskMgr.start(task);
2 title : "请稍等...",
3 msg : "服务器正在处理中...",
4 progress : true,
5 width : 300
6 });
7 var count = 0;
8 var bartext = "";
9 var curnum = 0;
10 var task = {
11 run : function() {
12 count++;
13 if (flag != "保存中") {
14 progressBar.hide();
15 Ext.TaskMgr.stop(task);
16 }
17 if (count < 10) {
18 curnum = count / 10;
19 bartext = curnum * 100 + "%";
20 } else {
21 curnum = 9.9;
22 bartext = 99 + "%";
23 }
24 progressBar.updateProgress(curnum, bartext);
25 },
26 interval : 500
27 }
28 Ext.TaskMgr.start(task);