如何将dojo.connect代码从Dojo 1.3.1迁移到1.9.3 [英] How to migrate dojo.connect code from Dojo 1.3.1 to 1.9.3
问题描述
我在应用程序中有以下代码,它是以 Dojo 1.3.1 编写的。我的任务如果将此代码迁移到 Dojo 1.9.3 。我的问题是我如何才能实现这一点?我是Dojo的新手,所以不太了解从旧的Dojo语法迁移到新的。
I've following piece of code in my application which is written in Dojo 1.3.1. My task if to migrate this code to Dojo 1.9.3. My questions is that how I can achieve this? I'm a newbie to Dojo so don't know much about migration from old Dojo syntax to new.
dialogWidget._proxyConnects.push(dojo.connect(
newDialog._fadeIn,
"onEnd",
dialogWidget,
"onLoad"
));
编辑
我也想知道上面的代码段实际上会做什么?如果有人可以用一两句话向我解释一下。
谢谢
EDIT
I would also like to know that what the above piece of code will do actually? If anyone can explain this to me in one or two sentences.
Thanks
推荐答案
This part of Dojo migration guide should help you out.
正如你所做的那样 - 你推送一个(Dojo)连接甚至处理程序,这将执行 onLoad
方法 $
。为什么 - 我不能真的说,因为我不知道这个运行的上下文。此外,由于它访问私人财产的 newDialog._fadeIn
在 onEnd
事件中触发dialogWidget dialogWidget
,我不会'不要惊讶,这会在更新过程中中断。
As on what this does -- you're pushing a (Dojo) connect even handler, that would execute an onLoad
method of dialogWidget
after newDialog._fadeIn
fires onEnd
event. What for -- I can't really say, since I don't know the context this one is run in. Also since it accesses private property of dialogWidget
, I wouldn't be surprised that this would break during update.
希望这有帮助。
这篇关于如何将dojo.connect代码从Dojo 1.3.1迁移到1.9.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!