ext动态进度条

定时查询更新进度条,如果具体的修改状态操作可以在另一个ajax请求里写
var task = {
    interval: 10000,   //每10秒更新
    run: function () {
        var msgBox = Ext.MessageBox.show({
            title: '下发进度',
            msg: '正在下发!',
            progress: true,
            width: 400,
            buttons: Ext.Msg.OK,
            scope: document.body
        });

        Ext.Ajax.request({
            url: 'Door/getSendCount',
            params: {},
            disableCaching: true,//禁止缓存
            timeout: 30000,//最大等待时间,超出则会触发超时
            method: "GET",
            success: function (response, opts) {
                var ret = Ext.JSON.decode(response.responseText);      //JSON对象化
                var total = ret.total;
                var count = ret.count;
                if (count != total) {
                    //计算进度
                    var percentage = count / total;
                    //显示内容
                    var processText = '下发数量:' + total + ';已完成数量' + count + '; ';
                    //更新进度条;
                    msgBox.updateProgress(percentage, processText, '下发进度');
                }
                else {
                    msgBox.hide();
                    Ext.TaskManager.stop(task);
                    win.show();
                }
            },
            failure: function (response, opts) {

            }
        });
    }
}
Ext.TaskManager.start(task);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值