source: trunk/web/addons/job_monarch/lib/extjs/docs/output/Ext.util.Observable.html @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 22.7 KB
Line 
1        <div class="body-wrap">
2        <div class="top-tools">
3            <a class="inner-link" href="#Ext.util.Observable-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4            <a class="inner-link" href="#Ext.util.Observable-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5            <a class="inner-link" href="#Ext.util.Observable-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6                            <a class="inner-link" href="#Ext.util.Observable-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7                        <a class="bookmark" href="../docs/?class=Ext.util.Observable"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8        </div>
9                <h1>Class Ext.util.Observable</h1>
10        <table cellspacing="0">
11            <tr><td class="label">Package:</td><td class="hd-info">Ext.util</td></tr>
12            <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/Observable.js" target="_blank">Observable.js</a></td></tr>
13            <tr><td class="label">Class:</td><td class="hd-info">Observable</td></tr>
14                        <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.Component" href="output/Ext.Component.html">Component</a>, <a ext:cls="Ext.History" href="output/Ext.History.html">History</a>, <a ext:cls="Ext.Resizable" href="output/Ext.Resizable.html">Resizable</a>, <a ext:cls="Ext.SplitBar" href="output/Ext.SplitBar.html">SplitBar</a>, <a ext:cls="Ext.Updater" href="output/Ext.Updater.html">Updater</a>, <a ext:cls="Ext.air.NativeObservable" href="output/Ext.air.NativeObservable.html">NativeObservable</a>, <a ext:cls="Ext.data.Connection" href="output/Ext.data.Connection.html">Connection</a>, <a ext:cls="Ext.data.DataProxy" href="output/Ext.data.DataProxy.html">DataProxy</a>, <a ext:cls="Ext.data.Node" href="output/Ext.data.Node.html">Node</a>, <a ext:cls="Ext.data.Store" href="output/Ext.data.Store.html">Store</a>, <a ext:cls="Ext.data.Tree" href="output/Ext.data.Tree.html">Tree</a>, <a ext:cls="Ext.form.BasicForm" href="output/Ext.form.BasicForm.html">BasicForm</a>, <a ext:cls="Ext.grid.AbstractSelectionModel" href="output/Ext.grid.AbstractSelectionModel.html">AbstractSelectionModel</a>, <a ext:cls="Ext.grid.ColumnModel" href="output/Ext.grid.ColumnModel.html">ColumnModel</a>, <a ext:cls="Ext.grid.GridView" href="output/Ext.grid.GridView.html">GridView</a>, <a ext:cls="Ext.grid.PropertyStore" href="output/Ext.grid.PropertyStore.html">PropertyStore</a>, <a ext:cls="Ext.menu.Menu" href="output/Ext.menu.Menu.html">Menu</a>, <a ext:cls="Ext.tree.DefaultSelectionModel" href="output/Ext.tree.DefaultSelectionModel.html">DefaultSelectionModel</a>, <a ext:cls="Ext.tree.MultiSelectionModel" href="output/Ext.tree.MultiSelectionModel.html">MultiSelectionModel</a>, <a ext:cls="Ext.tree.TreeLoader" href="output/Ext.tree.TreeLoader.html">TreeLoader</a>, <a ext:cls="Ext.util.ClickRepeater" href="output/Ext.util.ClickRepeater.html">ClickRepeater</a>, <a ext:cls="Ext.util.MixedCollection" href="output/Ext.util.MixedCollection.html">MixedCollection</a></td></tr>
15                                    <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
16                    </table>
17        <div class="description">
18            *
19Abstract base class that provides a common interface for publishing events. Subclasses are expected to
20to have a property "events" with all the events defined.<br>
21For example:
22<pre><code>Employee = <b>function</b>(name){
23    <b>this</b>.name = name;
24    <b>this</b>.addEvents({
25        <em>"fired"</em> : true,
26        <em>"quit"</em> : true
27    });
28 }
29 Ext.extend(Employee, Ext.util.Observable);</code></pre>        </div>
30       
31        <div class="hr"></div>
32                <a id="Ext.util.Observable-configs"></a>
33        <h2>Config Options</h2>
34        <table cellspacing="0" class="member-table">
35            <tr>
36                <th class="sig-header" colspan="2">Config Options</th>
37                <th class="msource-header">Defined By</th>
38            </tr>
39                <tr class="config-row expandable">
40        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
41        <td class="sig">
42        <a id="Ext.util.Observable-listeners"></a>
43            <b>listeners</b> : Object            <div class="mdesc">
44                        <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
45            <div class="long">
46                (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>
47                        </div>
48        </td>
49        <td class="msource">Observable</td>
50    </tr>
51            </table>
52                <a id="Ext.util.Observable-props"></a>
53        <h2>Public Properties</h2>
54        <div class="no-members">This class has no public properties.</div>        <a id="Ext.util.Observable-methods"></a>
55        <h2>Public Methods</h2>
56                <table cellspacing="0" class="member-table">
57            <tr>
58                <th class="sig-header" colspan="2">Method</th>
59                <th class="msource-header">Defined By</th>
60            </tr>
61                <tr class="method-row expandable">
62        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
63        <td class="sig">
64        <a id="Ext.util.Observable-Observable.capture"></a>
65            <b>Observable.capture</b>(&nbsp;<code>Observable o</code>, <code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : void            <div class="mdesc">
66                        <div class="short">&lt;static&gt; Starts capture on the specified Observable. All events will be passed
67to the supplied function with th...</div>
68            <div class="long">
69                &lt;static&gt; Starts capture on the specified Observable. All events will be passed
70to the supplied function with the event name + standard signature of the event
71<b>before</b> the event is fired. If the supplied function returns false,
72the event will not fire.    <div class="mdetail-params">
73        <strong>Parameters:</strong>
74        <ul><li><code>o</code> : Observable<div class="sub-desc">The Observable to capture</div></li><li><code>fn</code> : Function<div class="sub-desc">The function to call</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the fn</div></li>        </ul>
75        <strong>Returns:</strong>
76        <ul>
77            <li><code>void</code></li>
78        </ul>
79    </div>
80                </div>
81                        </div>
82        </td>
83        <td class="msource">Observable</td>
84    </tr>
85        <tr class="method-row alt expandable">
86        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
87        <td class="sig">
88        <a id="Ext.util.Observable-Observable.releaseCapture"></a>
89            <b>Observable.releaseCapture</b>(&nbsp;<code>Observable o</code>&nbsp;) : void            <div class="mdesc">
90                        <div class="short">&lt;static&gt; Removes <b>all</b> added captures from the Observable.</div>
91            <div class="long">
92                &lt;static&gt; Removes <b>all</b> added captures from the Observable.    <div class="mdetail-params">
93        <strong>Parameters:</strong>
94        <ul><li><code>o</code> : Observable<div class="sub-desc">The Observable to release</div></li>        </ul>
95        <strong>Returns:</strong>
96        <ul>
97            <li><code>void</code></li>
98        </ul>
99    </div>
100                </div>
101                        </div>
102        </td>
103        <td class="msource">Observable</td>
104    </tr>
105        <tr class="method-row expandable">
106        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
107        <td class="sig">
108        <a id="Ext.util.Observable-addEvents"></a>
109            <b>addEvents</b>(&nbsp;<code>Object object</code>&nbsp;) : void            <div class="mdesc">
110                        <div class="short">Used to define events on this Observable</div>
111            <div class="long">
112                Used to define events on this Observable    <div class="mdetail-params">
113        <strong>Parameters:</strong>
114        <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li>        </ul>
115        <strong>Returns:</strong>
116        <ul>
117            <li><code>void</code></li>
118        </ul>
119    </div>
120                </div>
121                        </div>
122        </td>
123        <td class="msource">Observable</td>
124    </tr>
125        <tr class="method-row alt expandable">
126        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
127        <td class="sig">
128        <a id="Ext.util.Observable-addListener"></a>
129            <b>addListener</b>(&nbsp;<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>&nbsp;) : void            <div class="mdesc">
130                        <div class="short">Appends an event handler to this component</div>
131            <div class="long">
132                Appends an event handler to this component    <div class="mdetail-params">
133        <strong>Parameters:</strong>
134        <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
135function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
136properties. This may contain any of the following properties:<ul>
137<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>
138<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>
139<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>
140<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
141by the specified number of milliseconds. If the event fires again within that time, the original
142handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
143</ul><br>
144<p>
145<b>Combining Options</b><br>
146Using the options argument, it is possible to combine different types of listeners:<br>
147<br>
148A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
149<pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
150    single: true,
151    delay: 100,
152    forumId: 4
153});</code></pre>
154<p>
155<b>Attaching multiple handlers in 1 call</b><br>
156The method also allows for a single argument to be passed which is a config object containing properties
157which specify multiple handlers.
158<p>
159<pre><code>foo.on({
160    <em>'click'</em> : {
161        fn: <b>this</b>.onClick,
162        scope: <b>this</b>,
163        delay: 100
164    },
165    <em>'mouseover'</em> : {
166        fn: <b>this</b>.onMouseOver,
167        scope: <b>this</b>
168    },
169    <em>'mouseout'</em> : {
170        fn: <b>this</b>.onMouseOut,
171        scope: <b>this</b>
172    }
173});</code></pre>
174<p>
175Or a shorthand syntax:<br>
176<pre><code>foo.on({
177    <em>'click'</em> : <b>this</b>.onClick,
178    <em>'mouseover'</em> : <b>this</b>.onMouseOver,
179    <em>'mouseout'</em> : <b>this</b>.onMouseOut,
180     scope: <b>this</b>
181});</code></pre></div></li>        </ul>
182        <strong>Returns:</strong>
183        <ul>
184            <li><code>void</code></li>
185        </ul>
186    </div>
187                </div>
188                        </div>
189        </td>
190        <td class="msource">Observable</td>
191    </tr>
192        <tr class="method-row expandable">
193        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
194        <td class="sig">
195        <a id="Ext.util.Observable-fireEvent"></a>
196            <b>fireEvent</b>(&nbsp;<code>String eventName</code>, <code>Object... args</code>&nbsp;) : Boolean            <div class="mdesc">
197                        <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
198            <div class="long">
199                Fires the specified event with the passed parameters (minus the event name).    <div class="mdetail-params">
200        <strong>Parameters:</strong>
201        <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>
202        <strong>Returns:</strong>
203        <ul>
204            <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
205        </ul>
206    </div>
207                </div>
208                        </div>
209        </td>
210        <td class="msource">Observable</td>
211    </tr>
212        <tr class="method-row alt expandable">
213        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
214        <td class="sig">
215        <a id="Ext.util.Observable-hasListener"></a>
216            <b>hasListener</b>(&nbsp;<code>String eventName</code>&nbsp;) : Boolean            <div class="mdesc">
217                        <div class="short">Checks to see if this object has any listeners for a specified event</div>
218            <div class="long">
219                Checks to see if this object has any listeners for a specified event    <div class="mdetail-params">
220        <strong>Parameters:</strong>
221        <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li>        </ul>
222        <strong>Returns:</strong>
223        <ul>
224            <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
225        </ul>
226    </div>
227                </div>
228                        </div>
229        </td>
230        <td class="msource">Observable</td>
231    </tr>
232        <tr class="method-row expandable">
233        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
234        <td class="sig">
235        <a id="Ext.util.Observable-on"></a>
236            <b>on</b>(&nbsp;<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>&nbsp;) : void            <div class="mdesc">
237                        <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
238            <div class="long">
239                Appends an event handler to this element (shorthand for addListener)    <div class="mdetail-params">
240        <strong>Parameters:</strong>
241        <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
242function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li>        </ul>
243        <strong>Returns:</strong>
244        <ul>
245            <li><code>void</code></li>
246        </ul>
247    </div>
248                </div>
249                        </div>
250        </td>
251        <td class="msource">Observable</td>
252    </tr>
253        <tr class="method-row alt expandable">
254        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
255        <td class="sig">
256        <a id="Ext.util.Observable-purgeListeners"></a>
257            <b>purgeListeners</b>() : void            <div class="mdesc">
258                        <div class="short">Removes all listeners for this object</div>
259            <div class="long">
260                Removes all listeners for this object    <div class="mdetail-params">
261        <strong>Parameters:</strong>
262        <ul><li>None.</li>        </ul>
263        <strong>Returns:</strong>
264        <ul>
265            <li><code>void</code></li>
266        </ul>
267    </div>
268                </div>
269                        </div>
270        </td>
271        <td class="msource">Observable</td>
272    </tr>
273        <tr class="method-row expandable">
274        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
275        <td class="sig">
276        <a id="Ext.util.Observable-relayEvents"></a>
277            <b>relayEvents</b>(&nbsp;<code>Object o</code>, <code>Array events</code>&nbsp;) : void            <div class="mdesc">
278                        <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
279            <div class="long">
280                Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.    <div class="mdetail-params">
281        <strong>Parameters:</strong>
282        <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>
283        <strong>Returns:</strong>
284        <ul>
285            <li><code>void</code></li>
286        </ul>
287    </div>
288                </div>
289                        </div>
290        </td>
291        <td class="msource">Observable</td>
292    </tr>
293        <tr class="method-row alt expandable">
294        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
295        <td class="sig">
296        <a id="Ext.util.Observable-removeListener"></a>
297            <b>removeListener</b>(&nbsp;<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : void            <div class="mdesc">
298                        <div class="short">Removes a listener</div>
299            <div class="long">
300                Removes a listener    <div class="mdetail-params">
301        <strong>Parameters:</strong>
302        <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>
303        <strong>Returns:</strong>
304        <ul>
305            <li><code>void</code></li>
306        </ul>
307    </div>
308                </div>
309                        </div>
310        </td>
311        <td class="msource">Observable</td>
312    </tr>
313        <tr class="method-row expandable">
314        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
315        <td class="sig">
316        <a id="Ext.util.Observable-resumeEvents"></a>
317            <b>resumeEvents</b>() : void            <div class="mdesc">
318                        <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>
319            <div class="long">
320                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">
321        <strong>Parameters:</strong>
322        <ul><li>None.</li>        </ul>
323        <strong>Returns:</strong>
324        <ul>
325            <li><code>void</code></li>
326        </ul>
327    </div>
328                </div>
329                        </div>
330        </td>
331        <td class="msource">Observable</td>
332    </tr>
333        <tr class="method-row alt expandable">
334        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
335        <td class="sig">
336        <a id="Ext.util.Observable-suspendEvents"></a>
337            <b>suspendEvents</b>() : void            <div class="mdesc">
338                        <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>
339            <div class="long">
340                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">
341        <strong>Parameters:</strong>
342        <ul><li>None.</li>        </ul>
343        <strong>Returns:</strong>
344        <ul>
345            <li><code>void</code></li>
346        </ul>
347    </div>
348                </div>
349                        </div>
350        </td>
351        <td class="msource">Observable</td>
352    </tr>
353        <tr class="method-row expandable">
354        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
355        <td class="sig">
356        <a id="Ext.util.Observable-un"></a>
357            <b>un</b>(&nbsp;<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : void            <div class="mdesc">
358                        <div class="short">Removes a listener (shorthand for removeListener)</div>
359            <div class="long">
360                Removes a listener (shorthand for removeListener)    <div class="mdetail-params">
361        <strong>Parameters:</strong>
362        <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>
363        <strong>Returns:</strong>
364        <ul>
365            <li><code>void</code></li>
366        </ul>
367    </div>
368                </div>
369                        </div>
370        </td>
371        <td class="msource">Observable</td>
372    </tr>
373            </table>
374                <a id="Ext.util.Observable-events"></a>
375        <h2>Public Events</h2>
376        <div class="no-members">This class has no public events.</div>
377        </div>
Note: See TracBrowser for help on using the repository browser.