Evented

dojo/Evented

Summary

A class that can be used as a mixin or base class, to add on() and emit() methods to a class for listening for events and emitting events:

See the dojo/Evented reference documentation for more information.

Examples

Example 1

define(["dojo/Evented", "dojo/_base/declare", "dojo/Stateful"
], function(Evented, declare, Stateful){
    var EventedStateful = declare([Evented, Stateful], {...});
    var instance = new EventedStateful();
    instance.on("open", function(event){
    ... do something with event
 });

instance.emit("open", {name:"some event", ...});

Methods

emit(type,event)

Defined by dojo/Evented

Parameter Type Description
type undefined
event undefined

Returns: undefined

on(type,listener)

Defined by dojo/Evented

Parameter Type Description
type undefined
listener undefined

Returns: undefined

© 2005–2015 The Dojo Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/Evented.html

停课不停学活动
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部