commit extjs-2.2.1
[extjs.git] / docs / output / Ext.EventManager.html
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>
7         </div>
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>
14                     </table>
15         <div class="description">
16             *
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>
20         
21         <div class="hr"></div>
22                 <a id="Ext.EventManager-props"></a>
23         <h2>Public Properties</h2>
24                 <table cellspacing="0" class="member-table">
25             <tr>
26                 <th class="sig-header" colspan="2">Property</th>
27                 <th class="msource-header">Defined By</th>
28             </tr>
29                 <tr class="property-row">\r
30         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
31         <td class="sig">\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
35         </td>\r
36         <td class="msource">EventManager</td>\r
37     </tr>\r
38         <tr class="property-row alt">\r
39         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
40         <td class="sig">\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
44         </td>\r
45         <td class="msource">EventManager</td>\r
46     </tr>\r
47             </table>
48                 <a id="Ext.EventManager-methods"></a>
49         <h2>Public Methods</h2>
50                 <table cellspacing="0" class="member-table">
51             <tr>
52                 <th class="sig-header" colspan="2">Method</th>
53                 <th class="msource-header">Defined By</th>
54             </tr>
55                 <tr class="method-row expandable">\r
56         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
57         <td class="sig">\r
58         <a id="Ext.EventManager-addListener"></a>\r
59             <b>addListener</b>(&nbsp;<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>&nbsp;) : 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
62             <div class="long">\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>
86 </ul><br>
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
89         <ul>\r
90             <li><code>void</code></li>\r
91         </ul>\r
92     </div>\r
93                 </div>\r
94                         </div>\r
95         </td>\r
96         <td class="msource">EventManager</td>\r
97     </tr>\r
98         <tr class="method-row alt expandable">\r
99         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
100         <td class="sig">\r
101         <a id="Ext.EventManager-on"></a>\r
102             <b>on</b>(&nbsp;<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>&nbsp;) : 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
104             <div class="long">\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
110         <ul>\r
111             <li><code>void</code></li>\r
112         </ul>\r
113     </div>\r
114                 </div>\r
115                         </div>\r
116         </td>\r
117         <td class="msource">EventManager</td>\r
118     </tr>\r
119         <tr class="method-row expandable">\r
120         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
121         <td class="sig">\r
122         <a id="Ext.EventManager-onDocumentReady"></a>\r
123             <b>onDocumentReady</b>(&nbsp;<code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>boolean options</code>]</span>&nbsp;) : 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
126             <div class="long">\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
132         <ul>\r
133             <li><code>void</code></li>\r
134         </ul>\r
135     </div>\r
136                 </div>\r
137                         </div>\r
138         </td>\r
139         <td class="msource">EventManager</td>\r
140     </tr>\r
141         <tr class="method-row alt expandable">\r
142         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
143         <td class="sig">\r
144         <a id="Ext.EventManager-onTextResize"></a>\r
145             <b>onTextResize</b>(&nbsp;<code>Function fn</code>, <code>Object scope</code>, <code>boolean options</code>&nbsp;) : 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
147             <div class="long">\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
152         <ul>\r
153             <li><code>void</code></li>\r
154         </ul>\r
155     </div>\r
156                 </div>\r
157                         </div>\r
158         </td>\r
159         <td class="msource">EventManager</td>\r
160     </tr>\r
161         <tr class="method-row expandable">\r
162         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
163         <td class="sig">\r
164         <a id="Ext.EventManager-onWindowResize"></a>\r
165             <b>onWindowResize</b>(&nbsp;<code>Function fn</code>, <code>Object scope</code>, <code>boolean options</code>&nbsp;) : 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
167             <div class="long">\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
172         <ul>\r
173             <li><code>void</code></li>\r
174         </ul>\r
175     </div>\r
176                 </div>\r
177                         </div>\r
178         </td>\r
179         <td class="msource">EventManager</td>\r
180     </tr>\r
181         <tr class="method-row alt expandable">\r
182         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
183         <td class="sig">\r
184         <a id="Ext.EventManager-removeAll"></a>\r
185             <b>removeAll</b>(&nbsp;<code>String/HTMLElement el</code>&nbsp;) : 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
188             <div class="long">\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
194         <ul>\r
195             <li><code>void</code></li>\r
196         </ul>\r
197     </div>\r
198                 </div>\r
199                         </div>\r
200         </td>\r
201         <td class="msource">EventManager</td>\r
202     </tr>\r
203         <tr class="method-row expandable">\r
204         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
205         <td class="sig">\r
206         <a id="Ext.EventManager-removeListener"></a>\r
207             <b>removeListener</b>(&nbsp;<code>String/HTMLElement el</code>, <code>String eventName</code>, <code>Function fn</code>&nbsp;) : 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
210             <div class="long">\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
216         <ul>\r
217             <li><code>void</code></li>\r
218         </ul>\r
219     </div>\r
220                 </div>\r
221                         </div>\r
222         </td>\r
223         <td class="msource">EventManager</td>\r
224     </tr>\r
225         <tr class="method-row alt expandable">\r
226         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
227         <td class="sig">\r
228         <a id="Ext.EventManager-removeResizeListener"></a>\r
229             <b>removeResizeListener</b>(&nbsp;<code>Function fn</code>, <code>Object scope</code>&nbsp;) : void            <div class="mdesc">\r
230                         <div class="short">Removes the passed window resize listener.</div>\r
231             <div class="long">\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
236         <ul>\r
237             <li><code>void</code></li>\r
238         </ul>\r
239     </div>\r
240                 </div>\r
241                         </div>\r
242         </td>\r
243         <td class="msource">EventManager</td>\r
244     </tr>\r
245         <tr class="method-row expandable">\r
246         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
247         <td class="sig">\r
248         <a id="Ext.EventManager-un"></a>\r
249             <b>un</b>(&nbsp;<code>String/HTMLElement el</code>, <code>String eventName</code>, <code>Function fn</code>&nbsp;) : 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
251             <div class="long">\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
256         <ul>\r
257             <li><code>Boolean</code><div class="sub-desc">True if a listener was actually removed, else false</div></li>\r
258         </ul>\r
259     </div>\r
260                 </div>\r
261                         </div>\r
262         </td>\r
263         <td class="msource">EventManager</td>\r
264     </tr>\r
265             </table>
266                 <a id="Ext.EventManager-events"></a>
267         <h2>Public Events</h2>
268         <div class="no-members">This class has no public events.</div>
269         </div>