在Dojo进行中 [英] In progress wheel in Dojo
本文介绍了在Dojo进行中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的json请求需要相当长的一段时间,我应该向用户显示一些事情。
谢谢!
解决方案
我使用StandBy小部件做这个。以下片段显示如何。代码有点旧,不使用Philippe提到的延迟技术,但您可以轻松地执行此操作。
var url = ...
var xhrArgs = {
url:url,
handleAs:text,
load:dojo.hitch(this,function(data ){
this._standby.hide();
...做工作...
}),
错误: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);
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!
解决方案
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);
这篇关于在Dojo进行中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文