admin管理员组文章数量:1313750
I'd like to know when a Dojo form widget is parsed or ready so I can customize it dynamically. I am trying to achieve this by using the dojo.connect()
method. However, I am not sure what event to listen to. Is it onLoad
or onStartup
or..?
This is what I have done but it isn't triggering:
dojo.connect(dijit.byId('myWidget'), 'onStartup', function(evt) {
console.debug("test");
}
note that the dijit.byId('myWidget')
part returns the object correctly so that isn't the problem.
I'd like to know when a Dojo form widget is parsed or ready so I can customize it dynamically. I am trying to achieve this by using the dojo.connect()
method. However, I am not sure what event to listen to. Is it onLoad
or onStartup
or..?
This is what I have done but it isn't triggering:
dojo.connect(dijit.byId('myWidget'), 'onStartup', function(evt) {
console.debug("test");
}
note that the dijit.byId('myWidget')
part returns the object correctly so that isn't the problem.
4 Answers
Reset to default 3It depends somewhat on what exactly you are trying to customize (see the widget lifecycle here) but I would guess that connecting to postCreate
will satisfy your requirements
to answer my own question, there is a "startup" function in the widget lifecycle so I can use that instead of "onStartup" like so:
dojo.connect(dijit.byId('myWidget'), 'startup', function(evt) {
console.debug("test");
}
In my case I needed to wait for an external template. I made it like this:
var myCp= registry.byId("myContentPane");
myCp.set("onDownloadEnd", function(){
console.log("Download plete!");
});
myCp.set("href", "myHtml.html");
Well, if you wrap that code with a dojo.addOnLoad()
function call you should be good.
http://dojotoolkit/reference-guide/dojo/addOnLoad.html
本文标签: javascriptDojo on widget load eventStack Overflow
版权声明:本文标题:javascript - Dojo on widget load event - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741956286a2407007.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论