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 に答える