Dojo:指示小部件已渲染的事件
我在页面和 javascript 代码上有一个小部件:
<script type="text/javascript">
dojo.ready(function() {
dijit.byId("widgetId");
// oops, widget is not rendered yet, so this code can't find it.
})
</script>
那么我应该监听什么事件来指示小部件已呈现?
I have a widget on page and javascript code:
<script type="text/javascript">
dojo.ready(function() {
dijit.byId("widgetId");
// oops, widget is not rendered yet, so this code can't find it.
})
</script>
So what event should I listen to which indicates that widget is rendered?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您使用的框架似乎隐藏了大多数与 dojo 相关的配置,因此最简单的解决方案是在访问任何小部件之前调用
dojo.parser.parse()
。这将确保所有小部件都已创建并启动。Since you are using a framework which appears to hide most of the dojo related configurations, the simplest solution to this would be to call the
dojo.parser.parse()
before accessing any widgets. This will ensure that all widgets are created and started.