1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.air.NativeObservable-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.air.NativeObservable-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.air.NativeObservable-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.air.NativeObservable-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7 <a class="bookmark" href="../docs/?class=Ext.air.NativeObservable"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
9 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a>
11 <img src="resources/elbow-end.gif"/>NativeObservable</pre></div>
12 <h1>Class Ext.air.NativeObservable</h1>
13 <table cellspacing="0">
14 <tr><td class="label">Package:</td><td class="hd-info">Ext.air</td></tr>
15 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/NativeObservable.js" target="_blank">NativeObservable.js</a></td></tr>
16 <tr><td class="label">Class:</td><td class="hd-info">NativeObservable</td></tr>
17 <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.air.NativeWindow" href="output/Ext.air.NativeWindow.html">NativeWindow</a></td></tr>
18 <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a></td></tr>
20 <div class="description">
22 Adds ability for Ext Observable functionality to proxy events for native (AIR) object wrappers </div>
24 <div class="hr"></div>
25 <a id="Ext.air.NativeObservable-configs"></a>
26 <h2>Config Options</h2>
27 <table cellspacing="0" class="member-table">
29 <th class="sig-header" colspan="2">Config Options</th>
30 <th class="msource-header">Defined By</th>
32 <tr class="config-row inherited expandable">
\r
33 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
35 <a id="Ext.air.NativeObservable-listeners"></a>
\r
36 <b>listeners</b> : Object <div class="mdesc">
\r
37 <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
\r
39 (optional) A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the <a ext:cls="Ext.util.Observable" ext:member="addListener" href="output/Ext.util.Observable.html#addListener">addListener</a> example for attaching multiple handlers at once. </div>
\r
42 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
\r
45 <a id="Ext.air.NativeObservable-props"></a>
46 <h2>Public Properties</h2>
47 <div class="no-members">This class has no public properties.</div> <a id="Ext.air.NativeObservable-methods"></a>
48 <h2>Public Methods</h2>
49 <table cellspacing="0" class="member-table">
51 <th class="sig-header" colspan="2">Method</th>
52 <th class="msource-header">Defined By</th>
54 <tr class="method-row expandable">
\r
55 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
57 <a id="Ext.air.NativeObservable-NativeObservable"></a>
\r
58 <b>NativeObservable</b>() <div class="mdesc">
\r
59 <div class="short"></div>
\r
61 <div class="mdetail-params">
\r
62 <strong>Parameters:</strong>
\r
63 <ul><li>None.</li> </ul>
\r
64 <strong>Returns:</strong>
\r
66 <li><code></code></li>
\r
72 <td class="msource">NativeObservable</td>
\r
74 <tr class="method-row inherited alt expandable">
\r
75 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
77 <a id="Ext.air.NativeObservable-addEvents"></a>
\r
78 <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
\r
79 <div class="short">Used to define events on this Observable</div>
\r
81 Used to define events on this Observable <div class="mdetail-params">
\r
82 <strong>Parameters:</strong>
\r
83 <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
\r
84 <strong>Returns:</strong>
\r
86 <li><code>void</code></li>
\r
92 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
\r
94 <tr class="method-row inherited expandable">
\r
95 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
97 <a id="Ext.air.NativeObservable-addListener"></a>
\r
98 <b>addListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
99 <div class="short">Appends an event handler to this component</div>
\r
101 Appends an event handler to this component <div class="mdetail-params">
\r
102 <strong>Parameters:</strong>
\r
103 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
104 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
105 properties. This may contain any of the following properties:<ul>
106 <li><b>scope</b> : Object<p class="sub-desc">The scope in which to execute the handler function. The handler function's "this" context.</p></li>
107 <li><b>delay</b> : Number<p class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</p></li>
108 <li><b>single</b> : Boolean<p class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</p></li>
109 <li><b>buffer</b> : Number<p class="sub-desc">Causes the handler to be scheduled to run in an <a ext:cls="Ext.util.DelayedTask" href="output/Ext.util.DelayedTask.html">Ext.util.DelayedTask</a> delayed
110 by the specified number of milliseconds. If the event fires again within that time, the original
111 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
114 <b>Combining Options</b><br>
115 Using the options argument, it is possible to combine different types of listeners:<br>
117 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
118 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
124 <b>Attaching multiple handlers in 1 call</b><br>
125 The method also allows for a single argument to be passed which is a config object containing properties
126 which specify multiple handlers.
130 fn: <b>this</b>.onClick,
134 <em>'mouseover'</em> : {
135 fn: <b>this</b>.onMouseOver,
138 <em>'mouseout'</em> : {
139 fn: <b>this</b>.onMouseOut,
144 Or a shorthand syntax:<br>
146 <em>'click'</em> : <b>this</b>.onClick,
147 <em>'mouseover'</em> : <b>this</b>.onMouseOver,
148 <em>'mouseout'</em> : <b>this</b>.onMouseOut,
150 });</code></pre></div></li> </ul>
\r
151 <strong>Returns:</strong>
\r
153 <li><code>void</code></li>
\r
159 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
\r
161 <tr class="method-row inherited alt expandable">
\r
162 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
164 <a id="Ext.air.NativeObservable-fireEvent"></a>
\r
165 <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc">
\r
166 <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
\r
168 Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params">
\r
169 <strong>Parameters:</strong>
\r
170 <ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li> </ul>
\r
171 <strong>Returns:</strong>
\r
173 <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
\r
179 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
\r
181 <tr class="method-row inherited expandable">
\r
182 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
184 <a id="Ext.air.NativeObservable-hasListener"></a>
\r
185 <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc">
\r
186 <div class="short">Checks to see if this object has any listeners for a specified event</div>
\r
188 Checks to see if this object has any listeners for a specified event <div class="mdetail-params">
\r
189 <strong>Parameters:</strong>
\r
190 <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
\r
191 <strong>Returns:</strong>
\r
193 <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
\r
199 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
\r
201 <tr class="method-row inherited alt expandable">
\r
202 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
204 <a id="Ext.air.NativeObservable-on"></a>
\r
205 <b>on</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
206 <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
\r
208 Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params">
\r
209 <strong>Parameters:</strong>
\r
210 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
211 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
\r
212 <strong>Returns:</strong>
\r
214 <li><code>void</code></li>
\r
220 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
\r
222 <tr class="method-row inherited expandable">
\r
223 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
225 <a id="Ext.air.NativeObservable-purgeListeners"></a>
\r
226 <b>purgeListeners</b>() : void <div class="mdesc">
\r
227 <div class="short">Removes all listeners for this object</div>
\r
229 Removes all listeners for this object <div class="mdetail-params">
\r
230 <strong>Parameters:</strong>
\r
231 <ul><li>None.</li> </ul>
\r
232 <strong>Returns:</strong>
\r
234 <li><code>void</code></li>
\r
240 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
\r
242 <tr class="method-row inherited alt expandable">
\r
243 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
245 <a id="Ext.air.NativeObservable-relayEvents"></a>
\r
246 <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc">
\r
247 <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
\r
249 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params">
\r
250 <strong>Parameters:</strong>
\r
251 <ul><li><code>o</code> : Object<div class="sub-desc">The Observable whose events this object is to relay.</div></li><li><code>events</code> : Array<div class="sub-desc">Array of event names to relay.</div></li> </ul>
\r
252 <strong>Returns:</strong>
\r
254 <li><code>void</code></li>
\r
260 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
\r
262 <tr class="method-row inherited expandable">
\r
263 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
265 <a id="Ext.air.NativeObservable-removeListener"></a>
\r
266 <b>removeListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
267 <div class="short">Removes a listener</div>
\r
269 Removes a listener <div class="mdetail-params">
\r
270 <strong>Parameters:</strong>
\r
271 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
272 <strong>Returns:</strong>
\r
274 <li><code>void</code></li>
\r
280 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
\r
282 <tr class="method-row inherited alt expandable">
\r
283 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
285 <a id="Ext.air.NativeObservable-resumeEvents"></a>
\r
286 <b>resumeEvents</b>() : void <div class="mdesc">
\r
287 <div class="short">Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>)</div>
\r
289 Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>) <div class="mdetail-params">
\r
290 <strong>Parameters:</strong>
\r
291 <ul><li>None.</li> </ul>
\r
292 <strong>Returns:</strong>
\r
294 <li><code>void</code></li>
\r
300 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
\r
302 <tr class="method-row inherited expandable">
\r
303 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
305 <a id="Ext.air.NativeObservable-suspendEvents"></a>
\r
306 <b>suspendEvents</b>() : void <div class="mdesc">
\r
307 <div class="short">Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>)</div>
\r
309 Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>) <div class="mdetail-params">
\r
310 <strong>Parameters:</strong>
\r
311 <ul><li>None.</li> </ul>
\r
312 <strong>Returns:</strong>
\r
314 <li><code>void</code></li>
\r
320 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
\r
322 <tr class="method-row inherited alt expandable">
\r
323 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
325 <a id="Ext.air.NativeObservable-un"></a>
\r
326 <b>un</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
327 <div class="short">Removes a listener (shorthand for removeListener)</div>
\r
329 Removes a listener (shorthand for removeListener) <div class="mdetail-params">
\r
330 <strong>Parameters:</strong>
\r
331 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
332 <strong>Returns:</strong>
\r
334 <li><code>void</code></li>
\r
340 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
\r
343 <a id="Ext.air.NativeObservable-events"></a>
344 <h2>Public Events</h2>
345 <div class="no-members">This class has no public events.</div>