0

在开始长时间运行的进程之前,我通过此代码创建了一个新的 WL.BusyIndi​​cator ...

if (gblShowBusyIndicator) {
    busyIndicator = new WL.BusyIndicator('loader', 
        {text: 'Refreshing local sales data...',
        opacity: 0.85,
        fullScreen: true});
    busyIndicator.show();
}

是否可以在该过程中间歇性地更新“文本”参数?我尝试调用此函数,但它不起作用。有任何想法吗?

function setBusyIndicatorStatus(status) {
    try {
        if (busyIndicator.isVisible()) {
            busyIndicator({text: status});
        }       
    } catch (e) {
        if (gblLoggerOn) WL.Logger.debug(">> setBusyIndicatorStatus(" + status + ") failure... discarding");
    }
}
4

1 回答 1

0

经过一些额外的思考,这就是我解决问题的方法,但我想知道是否有比在代码中的某些点切换显示/隐藏不同状态消息更好的方法。

谢谢!

function setBusyIndicatorStatus(view, status) {
    if (gblLoggerOn) WL.Logger.debug(">> setBusyIndicatorStatus(" + view + ", " + status + ")");
    try {
        if (busyIndicator.isVisible()) busyIndicator.hide();    
    } catch (e) {
        if (gblLoggerOn) WL.Logger.debug(">> setBusyIndicatorStatus(" + view + ", " + status + ") failure... discarding");
    }

    busyIndicator = null;

    var options = {text: null, opacity: 0.85, fullScreen: true};
    options.text = status;

    busyIndicator = new WL.BusyIndicator(view, options);
    busyIndicator.show();   
}
于 2013-08-17T22:41:30.980 回答