dojo.connect解析
来源:互联网 发布:淘宝网秋季修身连衣裙 编辑:程序博客网 时间:2024/05/22 01:58
Connects method to event, so that after event fires, method does too. All connected functions are passed the same arguments as the event function was initially called with. You may connect as many methods to event as needed.
event must be a string. If obj is null, dojo.global is used.
null arguments may simply be omitted.
obj[event] can resolve to a function or undefined (null). If obj[event] is null, it is assigned a function.
The return value is a handle that is needed to remove this connection with dojo.disconnect.
parameter type description
If obj is a DOM node, set dontFix to true to prevent delegation of this connection to the DOM event manager.
Usage
Example 1
When obj.onchange(), do ui.update():
dojo.connect(obj, "onchange", ui, "update");dojo.connect(obj, "onchange", ui, ui.update); // same
Example 2
Using return value for disconnect:
var link = dojo.connect(obj, "onchange", ui, "update");...dojo.disconnect(link);
Example 3
When onglobalevent executes, watcher.handler is invoked:
dojo.connect(null, "onglobalevent", watcher, "handler");
Example 4
When ob.onCustomEvent executes, customEventHandler is invoked:
dojo.connect(ob, "onCustomEvent", null, "customEventHandler");dojo.connect(ob, "onCustomEvent", "customEventHandler"); // same
Example 5
When ob.onCustomEvent executes, customEventHandler is invoked with the same scope (this):
dojo.connect(ob, "onCustomEvent", null, customEventHandler);dojo.connect(ob, "onCustomEvent", customEventHandler); // same
Example 6
When globalEvent executes, globalHandler is invoked with the same scope (this):
dojo.connect(null, "globalEvent", null, globalHandler);dojo.connect("globalEvent", globalHandler); // same
- dojo.connect解析
- dojo.mixin、dojo.extend、dojo.delegate解析
- dojo.connect的使用问题
- dojo.connect用法(转)
- dojo CheckBox问题解析
- dojo初解和dojo.connect用法(转)
- dojo初解和dojo.connect用法(转)
- dojo.hitch与dojo.partial解析
- 使用dojo.connect()时要注意的几个问题
- Dojo的内建JSON解析模块
- 正确解析dojo的子小部件
- dojo
- dojo
- Dojo
- dojo
- dojo
- dojo
- Oracle Connect by 用法解析
- V4L2应用程序框架(转)
- VB:动态添加控件的示例
- MYSQL存储过程示例
- PyQt/QT打开文件浏览器
- bootloader与linux中位置无关代码(PIC)的分析理解
- dojo.connect解析
- mvc2模式
- MYSQL导入导出.sql文件
- Studying note of GCC-3.4.6 source (116)
- C语言中变量的地址是一个常量
- mysql课件
- 呼叫中心 IVR报表发布
- document.documentElement.scrollTop(获取滚动条位置)
- "同一 IIS 进程中不可能运行两个不同的 ASP.NET 版本"解决方案