text: Ext.data.JsonP.KISSY_Event_CustomEvent_Target({"tagname":"class","name":"KISSY.Event.CustomEvent.Target","autodetected":{},"files":[{"filename":"target.js","href":"target.html#KISSY-Event-CustomEvent-Target"}],"members":[{"name":"addTarget","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-addTarget","meta":{"chainable":true}},{"name":"detach","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-detach","meta":{"chainable":true}},{"name":"fire","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-fire","meta":{}},{"name":"getCustomEventObservable","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-getCustomEventObservable","meta":{"private":true}},{"name":"getTargets","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-getTargets","meta":{"private":true}},{"name":"on","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-on","meta":{"chainable":true}},{"name":"publish","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-publish","meta":{"chainable":true}},{"name":"removeTarget","tagname":"method","owner":"KISSY.Event.CustomEvent.Target","id":"method-removeTarget","meta":{"chainable":true}}],"alternateClassNames":[],"aliases":{},"id":"class-KISSY.Event.CustomEvent.Target","short_doc":"EventTarget provides the implementation for any object to publish, subscribe and fire to custom events,\nand also allo...","component":false,"superclasses":[],"subclasses":["KISSY.Base"],"mixedInto":[],"mixins":[],"parentMixins":[],"requires":[],"uses":[],"html":"<div><pre class=\"hierarchy\"><h4>Subclasses</h4><div class='dependency'><a href='#!/api/KISSY.Base' rel='KISSY.Base' class='docClass'>KISSY.Base</a></div><h4>Files</h4><div class='dependency'><a href='source/target.html#KISSY-Event-CustomEvent-Target' target='_blank'>target.js</a></div></pre><div class='doc-contents'><p>EventTarget provides the implementation for any object to publish, subscribe and fire to custom events,\nand also allows other EventTargets to target the object with events sourced from the other object.</p>\n\n<p>EventTarget is designed to be used with S.augment to allow events to be listened to and fired by name.</p>\n\n<p>This makes it possible for implementing code to subscribe to an event that either has not been created yet,\nor will not be created at all.</p>\n\n<pre class='inline-example '><code><a href=\"#!/api/KISSY-method-use\" rel=\"KISSY-method-use\" class=\"docClass\">KISSY.use</a>('event',function(S,Event){\n     var target = S.mix({}, Event.Target);\n     target.on('ok',function(){\n         document.writeln('ok fired @'+new Date());\n     });\n     target.fire('ok');\n });\n</code></pre>\n</div><div class='members'><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-method'>Methods</h3><div class='subsection'><div id='method-addTarget' class='member first-child not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-addTarget' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-addTarget' class='name expandable'>addTarget</a>( <span class='pre'>anotherTarget</span> ) : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a><span class=\"signature\"><span class='chainable' >chainable</span></span></div><div class='description'><div class='short'>Registers another EventTarget as a bubble target. ...</div><div class='long'><p>Registers another EventTarget as a bubble target.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>anotherTarget</span> : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a><div class='sub-desc'><p>Another EventTarget instance to add</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a></span><div class='sub-desc'><p>this</p>\n</div></li></ul></div></div></div><div id='method-detach' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-detach' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-detach' class='name expandable'>detach</a>( <span class='pre'>type, [fn], [context]</span> ) : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a><span class=\"signature\"><span class='chainable' >chainable</span></span></div><div class='description'><div class='short'>Detach one or more listeners from the specified event ...</div><div class='long'><p>Detach one or more listeners from the specified event</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>type</span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a><div class='sub-desc'><p>The name of the event</p>\n</div></li><li><span class='pre'>fn</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a> (optional)<div class='sub-desc'><p>The subscribed function to un-subscribe. if not supplied, all observers will be removed.</p>\n</div></li><li><span class='pre'>context</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a> (optional)<div class='sub-desc'><p>The custom object passed to subscribe.</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a></span><div class='sub-desc'><p>this</p>\n</div></li></ul></div></div></div><div id='method-fire' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-fire' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-fire' class='name expandable'>fire</a>( <span class='pre'>type, [eventData]</span> ) : *<span class=\"signature\"></span></div><div class='description'><div class='short'>Fire a custom event by name. ...</div><div class='long'><p>Fire a custom event by name.\nThe callback functions will be executed from the context specified when the event was created,\nand the <a href=\"#!/api/KISSY.Event.CustomEvent.Object\" rel=\"KISSY.Event.CustomEvent.Object\" class=\"docClass\">KISSY.Event.CustomEvent.Object</a> created will be mixed with eventData</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>type</span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a><div class='sub-desc'><p>The type of the event</p>\n</div></li><li><span class='pre'>eventData</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a> (optional)<div class='sub-desc'><p>The data will be mixed with <a href=\"#!/api/KISSY.Event.CustomEvent.Object\" rel=\"KISSY.Event.CustomEvent.Object\" class=\"docClass\">KISSY.Event.CustomEvent.Object</a> created</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'>*</span><div class='sub-desc'><p>If any listen returns false, then the returned value is false. else return the last listener's returned value</p>\n</div></li></ul></div></div></div><div id='method-getCustomEventObservable' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-getCustomEventObservable' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-getCustomEventObservable' class='name expandable'>getCustomEventObservable</a>( <span class='pre'>type, [create]</span> ) : <a href=\"#!/api/KISSY.Event.CustomEvent.CustomEventObservable\" rel=\"KISSY.Event.CustomEvent.CustomEventObservable\" class=\"docClass\">KISSY.Event.CustomEvent.CustomEventObservable</a><span class=\"signature\"><span class='private' >private</span></span></div><div class='description'><div class='short'>Get custom event for specified event ...</div><div class='long'><p>Get custom event for specified event</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>type</span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a><div class='sub-desc'><p>event type</p>\n</div></li><li><span class='pre'>create</span> : <a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a> (optional)<div class='sub-desc'><p>whether create custom event on fly</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/KISSY.Event.CustomEvent.CustomEventObservable\" rel=\"KISSY.Event.CustomEvent.CustomEventObservable\" class=\"docClass\">KISSY.Event.CustomEvent.CustomEventObservable</a></span><div class='sub-desc'>\n</div></li></ul></div></div></div><div id='method-getTargets' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-getTargets' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-getTargets' class='name expandable'>getTargets</a>( <span class='pre'></span> ) : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a>[]<span class=\"signature\"><span class='private' >private</span></span></div><div class='description'><div class='short'>all targets where current target's events bubble to ...</div><div class='long'><p>all targets where current target's events bubble to</p>\n<h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a>[]</span><div class='sub-desc'>\n</div></li></ul></div></div></div><div id='method-on' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-on' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-on' class='name expandable'>on</a>( <span class='pre'>type, fn, [context]</span> ) : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a><span class=\"signature\"><span class='chainable' >chainable</span></span></div><div class='description'><div class='short'>Subscribe a callback function to a custom event fired by this object or from an object that bubbles its events to thi...</div><div class='long'><p>Subscribe a callback function to a custom event fired by this object or from an object that bubbles its events to this object.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>type</span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a><div class='sub-desc'><p>The name of the event</p>\n</div></li><li><span class='pre'>fn</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a><div class='sub-desc'><p>The callback to execute in response to the event</p>\n</div></li><li><span class='pre'>context</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a> (optional)<div class='sub-desc'><p>this object in callback</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a></span><div class='sub-desc'><p>this</p>\n</div></li></ul></div></div></div><div id='method-publish' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-publish' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-publish' class='name expandable'>publish</a>( <span class='pre'>type, cfg</span> ) : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a><span class=\"signature\"><span class='chainable' >chainable</span></span></div><div class='description'><div class='short'>Creates a new custom event of the specified type ...</div><div class='long'><p>Creates a new custom event of the specified type</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>type</span> : <a href=\"#!/api/String\" rel=\"String\" class=\"docClass\">String</a><div class='sub-desc'><p>The type of the event</p>\n</div></li><li><span class='pre'>cfg</span> : <a href=\"#!/api/Object\" rel=\"Object\" class=\"docClass\">Object</a><div class='sub-desc'><p>Config params</p>\n<ul><li><span class='pre'>bubbles</span> : <a href=\"#!/api/Boolean\" rel=\"Boolean\" class=\"docClass\">Boolean</a> (optional)<div class='sub-desc'><p>whether or not this event bubbles</p>\n<p>Defaults to: <code>true</code></p></div></li><li><span class='pre'>defaultFn</span> : <a href=\"#!/api/Function\" rel=\"Function\" class=\"docClass\">Function</a> (optional)<div class='sub-desc'><p>this event's default action</p>\n</div></li></ul></div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a></span><div class='sub-desc'><p>this</p>\n</div></li></ul></div></div></div><div id='method-removeTarget' class='member  not-inherited'><a href='#' class='side expandable'><span>&nbsp;</span></a><div class='title'><div class='meta'><span class='defined-in' rel='KISSY.Event.CustomEvent.Target'>KISSY.Event.CustomEvent.Target</span><br/><a href='source/target.html#KISSY-Event-CustomEvent-Target-method-removeTarget' target='_blank' class='view-source'>view source</a></div><a href='#!/api/KISSY.Event.CustomEvent.Target-method-removeTarget' class='name expandable'>removeTarget</a>( <span class='pre'>anotherTarget</span> ) : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a><span class=\"signature\"><span class='chainable' >chainable</span></span></div><div class='description'><div class='short'>Removes a bubble target ...</div><div class='long'><p>Removes a bubble target</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>anotherTarget</span> : <a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a><div class='sub-desc'><p>Another EventTarget instance to remove</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'><a href=\"#!/api/KISSY.Event.CustomEvent.Target\" rel=\"KISSY.Event.CustomEvent.Target\" class=\"docClass\">KISSY.Event.CustomEvent.Target</a></span><div class='sub-desc'><p>this</p>\n</div></li></ul></div></div></div></div></div></div></div>","meta":{}});