1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.EventManager-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.EventManager-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.EventManager-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="bookmark" href="../docs/?class=Ext.EventManager"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8 <h1>Class Ext.EventManager</h1>
9 <table cellspacing="0">
10 <tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr>
11 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/EventManager.js" target="_blank">EventManager.js</a></td></tr>
12 <tr><td class="label">Class:</td><td class="hd-info">EventManager</td></tr>
13 <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
15 <div class="description">
17 Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides
18 several useful events directly.
19 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>
21 <div class="hr"></div>
22 <a id="Ext.EventManager-props"></a>
23 <h2>Public Properties</h2>
24 <table cellspacing="0" class="member-table">
26 <th class="sig-header" colspan="2">Property</th>
27 <th class="msource-header">Defined By</th>
29 <tr class="property-row">
\r
30 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
32 <a id="Ext.EventManager-ieDeferSrc"></a>
\r
33 <b>ieDeferSrc</b> : Object <div class="mdesc">
\r
34 Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL) </div>
\r
36 <td class="msource">EventManager</td>
\r
38 <tr class="property-row alt">
\r
39 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
41 <a id="Ext.EventManager-textResizeInterval"></a>
\r
42 <b>textResizeInterval</b> : Object <div class="mdesc">
\r
43 The frequency, in milliseconds, to check for text resize events (defaults to 50) </div>
\r
45 <td class="msource">EventManager</td>
\r
48 <a id="Ext.EventManager-methods"></a>
49 <h2>Public Methods</h2>
50 <table cellspacing="0" class="member-table">
52 <th class="sig-header" colspan="2">Method</th>
53 <th class="msource-header">Defined By</th>
55 <tr class="method-row expandable">
\r
56 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
58 <a id="Ext.EventManager-addListener"></a>
\r
59 <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">
\r
60 <div class="short">Appends an event handler to an element. The shorthand version on is equivalent. Typically you will
61 use Ext.Element....</div>
\r
63 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
64 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">
\r
65 <strong>Parameters:</strong>
\r
66 <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 This function is passed
67 the following parameters:<ul>
68 <li>evt : EventObject<div class="sub-desc">The <a ext:cls="Ext.EventObject" href="output/Ext.EventObject.html">EventObject</a> describing the event.</div></li>
69 <li>t : Element<div class="sub-desc">The <a ext:cls="Ext.Element" href="output/Ext.Element.html">Element</a> which was the target of the event.
70 Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>
71 <li>o : Object<div class="sub-desc">The options object from the addListener call.</div></li>
72 </ul></div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
73 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.
74 This may contain any of the following properties:<ul>
75 <li>scope {Object} : The scope in which to execute the handler function. The handler function's "this" context.</li>
76 <li>delegate {String} : A simple selector to filter the target or look for a descendant of the target</li>
77 <li>stopEvent {Boolean} : True to stop the event. That is stop propagation, and prevent the default action.</li>
78 <li>preventDefault {Boolean} : True to prevent the default action</li>
79 <li>stopPropagation {Boolean} : True to prevent event propagation</li>
80 <li>normalized {Boolean} : False to pass a browser event to the handler function instead of an Ext.EventObject</li>
81 <li>delay {Number} : The number of milliseconds to delay the invocation of the handler after te event fires.</li>
82 <li>single {Boolean} : True to add a handler to handle just the next firing of the event, and then remove itself.</li>
83 <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
84 by the specified number of milliseconds. If the event fires again within that time, the original
85 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>
87 <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>
\r
88 <strong>Returns:</strong>
\r
90 <li><code>void</code></li>
\r
96 <td class="msource">EventManager</td>
\r
98 <tr class="method-row alt expandable">
\r
99 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
101 <a id="Ext.EventManager-on"></a>
\r
102 <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">
\r
103 <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>
\r
105 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">
\r
106 <strong>Parameters:</strong>
\r
107 <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
108 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>
\r
109 <strong>Returns:</strong>
\r
111 <li><code>void</code></li>
\r
117 <td class="msource">EventManager</td>
\r
119 <tr class="method-row expandable">
\r
120 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
122 <a id="Ext.EventManager-onDocumentReady"></a>
\r
123 <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">
\r
124 <div class="short">Fires when the document is ready (before onload and before images are loaded). Can be
125 accessed shorthanded as Ext.onR...</div>
\r
127 Fires when the document is ready (before onload and before images are loaded). Can be
128 accessed shorthanded as Ext.onReady(). <div class="mdetail-params">
\r
129 <strong>Parameters:</strong>
\r
130 <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>
\r
131 <strong>Returns:</strong>
\r
133 <li><code>void</code></li>
\r
139 <td class="msource">EventManager</td>
\r
141 <tr class="method-row alt expandable">
\r
142 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
144 <a id="Ext.EventManager-onTextResize"></a>
\r
145 <b>onTextResize</b>( <code>Function fn</code>, <code>Object scope</code>, <code>boolean options</code> ) : void <div class="mdesc">
\r
146 <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>
\r
148 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">
\r
149 <strong>Parameters:</strong>
\r
150 <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>
\r
151 <strong>Returns:</strong>
\r
153 <li><code>void</code></li>
\r
159 <td class="msource">EventManager</td>
\r
161 <tr class="method-row expandable">
\r
162 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
164 <a id="Ext.EventManager-onWindowResize"></a>
\r
165 <b>onWindowResize</b>( <code>Function fn</code>, <code>Object scope</code>, <code>boolean options</code> ) : void <div class="mdesc">
\r
166 <div class="short">Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and...</div>
\r
168 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">
\r
169 <strong>Parameters:</strong>
\r
170 <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>
\r
171 <strong>Returns:</strong>
\r
173 <li><code>void</code></li>
\r
179 <td class="msource">EventManager</td>
\r
181 <tr class="method-row alt expandable">
\r
182 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
184 <a id="Ext.EventManager-removeAll"></a>
\r
185 <b>removeAll</b>( <code>String/HTMLElement el</code> ) : void <div class="mdesc">
\r
186 <div class="short">Removes all event handers from an element. Typically you will use Ext.Element.removeAllListeners
187 directly on an Elem...</div>
\r
189 Removes all event handers from an element. Typically you will use <a ext:cls="Ext.Element" ext:member="removeAllListeners" href="output/Ext.Element.html#removeAllListeners">Ext.Element.removeAllListeners</a>
190 directly on an Element in favor of calling this version. <div class="mdetail-params">
\r
191 <strong>Parameters:</strong>
\r
192 <ul><li><code>el</code> : String/HTMLElement<div class="sub-desc">The id or html element from which to remove the event</div></li> </ul>
\r
193 <strong>Returns:</strong>
\r
195 <li><code>void</code></li>
\r
201 <td class="msource">EventManager</td>
\r
203 <tr class="method-row expandable">
\r
204 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
206 <a id="Ext.EventManager-removeListener"></a>
\r
207 <b>removeListener</b>( <code>String/HTMLElement el</code>, <code>String eventName</code>, <code>Function fn</code> ) : void <div class="mdesc">
\r
208 <div class="short">Removes an event handler from an element. The shorthand version un is equivalent. Typically
209 you will use Ext.Elemen...</div>
\r
211 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
212 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">
\r
213 <strong>Parameters:</strong>
\r
214 <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>
\r
215 <strong>Returns:</strong>
\r
217 <li><code>void</code></li>
\r
223 <td class="msource">EventManager</td>
\r
225 <tr class="method-row alt expandable">
\r
226 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
228 <a id="Ext.EventManager-removeResizeListener"></a>
\r
229 <b>removeResizeListener</b>( <code>Function fn</code>, <code>Object scope</code> ) : void <div class="mdesc">
\r
230 <div class="short">Removes the passed window resize listener.</div>
\r
232 Removes the passed window resize listener. <div class="mdetail-params">
\r
233 <strong>Parameters:</strong>
\r
234 <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>
\r
235 <strong>Returns:</strong>
\r
237 <li><code>void</code></li>
\r
243 <td class="msource">EventManager</td>
\r
245 <tr class="method-row expandable">
\r
246 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
248 <a id="Ext.EventManager-un"></a>
\r
249 <b>un</b>( <code>String/HTMLElement el</code>, <code>String eventName</code>, <code>Function fn</code> ) : Boolean <div class="mdesc">
\r
250 <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>
\r
252 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">
\r
253 <strong>Parameters:</strong>
\r
254 <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>
\r
255 <strong>Returns:</strong>
\r
257 <li><code>Boolean</code><div class="sub-desc">True if a listener was actually removed, else false</div></li>
\r
263 <td class="msource">EventManager</td>
\r
266 <a id="Ext.EventManager-events"></a>
267 <h2>Public Events</h2>
268 <div class="no-members">This class has no public events.</div>