Subversion Repositories eFlore/Applications.cel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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