Ext.EventManager.html
17.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<div class="body-wrap">
<div class="top-tools">
<a class="inner-link" href="#Ext.EventManager-props"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-prop">Properties</a>
<a class="inner-link" href="#Ext.EventManager-methods"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-method">Methods</a>
<a class="inner-link" href="#Ext.EventManager-events"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-event">Events</a>
<a class="bookmark" href="../docs/?class=Ext.EventManager"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-fav">Direct Link</a>
</div>
<h1>Class Ext.EventManager</h1>
<table cellspacing="0">
<tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr>
<tr><td class="label">Defined In:</td><td class="hd-info"><a href="../source/core/EventManager_wev8.js" target="_blank">EventManager_wev8.js</a></td></tr>
<tr><td class="label">Class:</td><td class="hd-info">EventManager</td></tr>
<tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
</table>
<div class="description">
Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides
several useful events directly.
See <a ext:cls="Ext.EventObject" href="output/Ext.EventObject.html">Ext.EventObject</a> for more details on normalized event objects.<br><br><i>This class is a singleton and cannot be created directly.</i> </div>
<div class="hr"></div>
<a id="Ext.EventManager-props"></a>
<h2>Public Properties</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Property</th>
<th class="msource-header">Defined By</th>
</tr>
<tr class="property-row">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-ieDeferSrc"></a>
<b>ieDeferSrc</b> : Object <div class="mdesc">
Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL) </div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="property-row alt">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-textResizeInterval"></a>
<b>textResizeInterval</b> : Object <div class="mdesc">
The frequency, in milliseconds, to check for text resize events (defaults to 50) </div>
</td>
<td class="msource">EventManager</td>
</tr>
</table>
<a id="Ext.EventManager-methods"></a>
<h2>Public Methods</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Method</th>
<th class="msource-header">Defined By</th>
</tr>
<tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-addListener"></a>
<b>addListener</b>( <code>String/HTMLElement el</code>, <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">
<div class="short">Appends an event handler to an element. The shorthand version on is equivalent. Typically you will
use Ext.Element....</div>
<div class="long">
Appends an event handler to an element. The shorthand version <a ext:cls="Ext.EventManager" ext:member="on" href="output/Ext.EventManager.html#on">on</a> is equivalent. Typically you will
use <a ext:cls="Ext.Element" ext:member="addListener" href="output/Ext.Element.html#addListener">Ext.Element.addListener</a> directly on an Element in favor of calling this version. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement<div class="sub-desc">The html element or id to assign the event handler to</div></li><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 function the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
function (the handler function's "this" context)</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration properties.
This may contain any of the following properties:<ul>
<li>scope {Object} : The scope in which to execute the handler function. The handler function's "this" context.</li>
<li>delegate {String} : A simple selector to filter the target or look for a descendant of the target</li>
<li>stopEvent {Boolean} : True to stop the event. That is stop propagation, and prevent the default action.</li>
<li>preventDefault {Boolean} : True to prevent the default action</li>
<li>stopPropagation {Boolean} : True to prevent event propagation</li>
<li>normalized {Boolean} : False to pass a browser event to the handler function instead of an Ext.EventObject</li>
<li>delay {Number} : The number of milliseconds to delay the invocation of the handler after te event fires.</li>
<li>single {Boolean} : True to add a handler to handle just the next firing of the event, and then remove itself.</li>
<li>buffer {Number} : 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
by the specified number of milliseconds. If the event fires again within that time, the original
handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>
</ul><br>
<p>See <a ext:cls="Ext.Element" ext:member="addListener" href="output/Ext.Element.html#addListener">Ext.Element.addListener</a> for examples of how to use these options.</p></div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="method-row alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-on"></a>
<b>on</b>( <code>String/HTMLElement el</code>, <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">
<div class="short">Appends an event handler to an element. Shorthand for <a ext:cls="Ext.EventManager" ext:member="addListener" href="output/Ext.EventManager.html#addListener">addListener</a>.</div>
<div class="long">
Appends an event handler to an element. Shorthand for <a ext:cls="Ext.EventManager" ext:member="addListener" href="output/Ext.EventManager.html#addListener">addListener</a>. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement<div class="sub-desc">The html element or id to assign the event handler to</div></li><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 function the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
function (the handler function's "this" context)</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing standard <a ext:cls="Ext.EventManager" ext:member="addListener" href="output/Ext.EventManager.html#addListener">addListener</a> options</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-onDocumentReady"></a>
<b>onDocumentReady</b>( <code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>boolean options</code>]</span> ) : void <div class="mdesc">
<div class="short">Fires when the document is ready (before onload and before images are loaded). Can be
accessed shorthanded as Ext.onR...</div>
<div class="long">
Fires when the document is ready (before onload and before images are loaded). Can be
accessed shorthanded as Ext.onReady(). <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>fn</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) An object that becomes the scope of the handler</div></li><li><code>options</code> : boolean<div class="sub-desc">(optional) An object containing standard <a ext:cls="Ext.EventManager" ext:member="addListener" href="output/Ext.EventManager.html#addListener">addListener</a> options</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="method-row alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-onTextResize"></a>
<b>onTextResize</b>( <code>Function fn</code>, <code>Object scope</code>, <code>boolean options</code> ) : void <div class="mdesc">
<div class="short">Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.</div>
<div class="long">
Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>fn</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">An object that becomes the scope of the handler</div></li><li><code>options</code> : boolean<div class="sub-desc"></div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-onWindowResize"></a>
<b>onWindowResize</b>( <code>Function fn</code>, <code>Object scope</code>, <code>boolean options</code> ) : void <div class="mdesc">
<div class="short">Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and...</div>
<div class="long">
Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>fn</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">An object that becomes the scope of the handler</div></li><li><code>options</code> : boolean<div class="sub-desc"></div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="method-row alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-removeListener"></a>
<b>removeListener</b>( <code>String/HTMLElement el</code>, <code>String eventName</code>, <code>Function fn</code> ) : Boolean <div class="mdesc">
<div class="short">Removes an event handler from an element. The shorthand version un is equivalent. Typically
you will use Ext.Elemen...</div>
<div class="long">
Removes an event handler from an element. The shorthand version <a ext:cls="Ext.EventManager" ext:member="un" href="output/Ext.EventManager.html#un">un</a> is equivalent. Typically
you will use <a ext:cls="Ext.Element" ext:member="removeListener" href="output/Ext.Element.html#removeListener">Ext.Element.removeListener</a> directly on an Element in favor of calling this version. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement<div class="sub-desc">The id or html element from which to remove the event</div></li><li><code>eventName</code> : String<div class="sub-desc">The type of event</div></li><li><code>fn</code> : Function<div class="sub-desc">The handler function to remove</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code><div class="sub-desc">True if a listener was actually removed, else false</div></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-removeResizeListener"></a>
<b>removeResizeListener</b>( <code>Function fn</code>, <code>Object scope</code> ) : void <div class="mdesc">
<div class="short">Removes the passed window resize listener.</div>
<div class="long">
Removes the passed window resize listener. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>fn</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">The scope of handler</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
<tr class="method-row alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.EventManager-un"></a>
<b>un</b>( <code>String/HTMLElement el</code>, <code>String eventName</code>, <code>Function fn</code> ) : Boolean <div class="mdesc">
<div class="short">Removes an event handler from an element. Shorthand for <a ext:cls="Ext.EventManager" ext:member="removeListener" href="output/Ext.EventManager.html#removeListener">removeListener</a>.</div>
<div class="long">
Removes an event handler from an element. Shorthand for <a ext:cls="Ext.EventManager" ext:member="removeListener" href="output/Ext.EventManager.html#removeListener">removeListener</a>. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement<div class="sub-desc">The id or html element from which to remove the event</div></li><li><code>eventName</code> : String<div class="sub-desc">The type of event</div></li><li><code>fn</code> : Function<div class="sub-desc">The handler function to remove</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code><div class="sub-desc">True if a listener was actually removed, else false</div></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">EventManager</td>
</tr>
</table>
<a id="Ext.EventManager-events"></a>
<h2>Public Events</h2>
<div class="no-members">This class has no public events.</div>
</div>