In progress wheel in Dojo

戏子无情 提交于 2019-12-11 05:32:54

问题


Is there a "in progress" wheel as a dojo/dijit widget?

My json request takes quite some time and I should show the user that something is going on.

Thanks!


回答1:


I use the StandBy widget to do this. The following snippet shows how. The code is a bit old and doesn't use the deferred technique that Philippe mentioned, but you could easily do so.

var url = ...

var xhrArgs = {
    url: url,
    handleAs: "text",
    load: dojo.hitch(this, function(data) {

      this._standby.hide();

      ... do work ...                   

    }),
    error: dojo.hitch(this, function(error){
      this._standby.hide();
      throw error;
    })
};

if (!this._standby) {
    this._standby = new dojox.widget.Standby({
      target: this.domNode
    });
    dojo.body().appendChild(this._standby.domNode);
}

this._standby.show();
dojo.xhrPost(xhrArgs);


来源:https://stackoverflow.com/questions/9783712/in-progress-wheel-in-dojo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!