Ext.MessageBox.Show使用Progress

在此之前,先添加引用:以下引用方式仅供参考:由于我的extjs文件夹放在script文件夹下

    <link href="~/Scripts/extjs/resources/ext-theme-neptune/ext-theme-neptune-all.css" rel="stylesheet" />
    <!--4.0后用bootstrap.js替代adapter\-->
    <script src="~/Scripts/extjs/bootstrap.js"></script>
    <script src="~/Scripts/extjs/locale/ext-lang-zh_CN.js"></script>

<script type="text/javascript" >

Ext.onReady(function () {
            //Show progress dialog
            Ext.Msg.show({
                title: "Message",
                msg: "Loading,please wait...",
                icon: Ext.Msg.INFO,
                progress: true,
                closable: false,
                width:350,
                fn: function (btn, txt) {
                    //alert(Ext.String.format("click the '{0}' value is '{1}'", btn, txt));
                }
            });
            //progress bar refresh count、percent、display msg
            var count = 0, percent = 0, progressMsg;
            //define timers task to update progress info
            var task = {
                run: function () {
                    count++;
                    percent = count;
                   // Ext.Msg.alert("d",percent);
                    progressMsg = Ext.String.format("当前进度:{0}%,当前时间:{1}", percent,Ext.Date.format(new Date(),"Y-m-d H:i:s ms"));
                    Ext.Msg.updateProgress(percent/100, progressMsg);
                    if (count >= 100)
                    {
                        Ext.TaskManager.stop(task);
                        //Ext.Msg.hide("destory");
                        Ext.Msg.alert("信息", "加载完毕");
                    }
                },
                interval:10
            };
            Ext.TaskManager.start(task);
        })

</script>

o啦,就这么简单就可以创建一个progress,如图:

连css都省了 爽吧!

以上仅供参考,如有问题 欢迎指出...

转载于:https://www.cnblogs.com/xiexingen/p/3372210.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值