sync
[roojs1] / docs / symbols / Roo.EventManager.json
1 {
2   "name" : "Roo.EventManager",
3   "augments" : [],
4   "childClasses" : [],
5   "desc" : "Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides \nseveral useful events directly.\nSee {@link Roo.EventObject} for more details on normalized event objects.",
6   "isSingleton" : true,
7   "isStatic" : false,
8   "isBuiltin" : false,
9   "memberOf" : "EventManager",
10   "example" : "",
11   "deprecated" : "",
12   "since" : "",
13   "see" : "",
14   "params" : [],
15   "returns" : [],
16   "throws" : "",
17   "requires" : "",
18   "config" : [],
19   "methods" : [
20     {
21       "name" : "addListener",
22       "type" : "function",
23       "desc" : "Appends an event handler to an element (shorthand for addListener)",
24       "sig" : "(element, eventName, handler, scope, options)",
25       "static" : true,
26       "memberOf" : "",
27       "isStatic" : true,
28       "isConstructor" : false,
29       "isPrivate" : false,
30       "example" : "",
31       "deprecated" : "",
32       "since" : "",
33       "see" : "",
34       "exceptions" : "",
35       "requires" : "",
36       "params" : [
37         {
38           "name" : "element",
39           "type" : "String/HTMLElement",
40           "desc" : "The html element or id to assign the",
41           "isOptional" : false
42         },
43         {
44           "name" : "eventName",
45           "type" : "String",
46           "desc" : "The type of event to listen for",
47           "isOptional" : false
48         },
49         {
50           "name" : "handler",
51           "type" : "Function",
52           "desc" : "The method the event invokes",
53           "isOptional" : false
54         },
55         {
56           "name" : "scope",
57           "type" : "Object",
58           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
59           "isOptional" : false
60         },
61         {
62           "name" : "options",
63           "type" : "Object",
64           "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:<ul>\n<li>scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.</li>\n<li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li>\n<li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li>\n<li>preventDefault {Boolean} True to prevent the default action</li>\n<li>stopPropagation {Boolean} True to prevent event propagation</li>\n<li>normalized {Boolean} False to pass a browser event to the handler function instead of an Roo.EventObject</li>\n<li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>\n<li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>\n<li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>\n</ul><br>\n<p>\n<b>Combining Options</b><br>\nUsing the options argument, it is possible to combine different types of listeners:<br>\n<br>\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style=\"margin: 5px 20px 20px;\">\nCode:<pre><code>\nel.on('click', this.onClick, this, {\n    single: true,\n    delay: 100,\n    stopEvent : true,\n    forumId: 4\n});</code></pre>\n<p>\n<b>Attaching multiple handlers in 1 call</b><br>\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n<p>\nCode:<pre><code>\nel.on({\n    'click' : {\n        fn: this.onClick\n        scope: this,\n        delay: 100\n    },\n    'mouseover' : {\n        fn: this.onMouseOver\n        scope: this\n    },\n    'mouseout' : {\n        fn: this.onMouseOut\n        scope: this\n    }\n});</code></pre>\n<p>\nOr a shorthand syntax:<br>\nCode:<pre><code>\nel.on({\n    'click' : this.onClick,\n    'mouseover' : this.onMouseOver,\n    'mouseout' : this.onMouseOut\n    scope: this\n});</code></pre>",
65           "isOptional" : false
66         }
67       ],
68       "returns" : []
69     },
70     {
71       "name" : "onDocumentReady",
72       "type" : "function",
73       "desc" : "Fires when the document is ready (before onload and before images are loaded). Can be \naccessed shorthanded Roo.onReady().",
74       "sig" : "(fn, scope, options)",
75       "static" : true,
76       "memberOf" : "",
77       "isStatic" : true,
78       "isConstructor" : false,
79       "isPrivate" : false,
80       "example" : "",
81       "deprecated" : "",
82       "since" : "",
83       "see" : "",
84       "exceptions" : "",
85       "requires" : "",
86       "params" : [
87         {
88           "name" : "fn",
89           "type" : "Function",
90           "desc" : "The method the event invokes",
91           "isOptional" : false
92         },
93         {
94           "name" : "scope",
95           "type" : "Object",
96           "desc" : "An  object that becomes the scope of the handler",
97           "isOptional" : false
98         },
99         {
100           "name" : "options",
101           "type" : "boolean",
102           "desc" : "",
103           "isOptional" : false
104         }
105       ],
106       "returns" : []
107     },
108     {
109       "name" : "onTextResize",
110       "type" : "function",
111       "desc" : "Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.",
112       "sig" : "(fn, scope, options)",
113       "static" : true,
114       "memberOf" : "",
115       "isStatic" : true,
116       "isConstructor" : false,
117       "isPrivate" : false,
118       "example" : "",
119       "deprecated" : "",
120       "since" : "",
121       "see" : "",
122       "exceptions" : "",
123       "requires" : "",
124       "params" : [
125         {
126           "name" : "fn",
127           "type" : "Function",
128           "desc" : "The method the event invokes",
129           "isOptional" : false
130         },
131         {
132           "name" : "scope",
133           "type" : "Object",
134           "desc" : "An object that becomes the scope of the handler",
135           "isOptional" : false
136         },
137         {
138           "name" : "options",
139           "type" : "boolean",
140           "desc" : "",
141           "isOptional" : false
142         }
143       ],
144       "returns" : []
145     },
146     {
147       "name" : "on",
148       "type" : "function",
149       "desc" : "Appends an event handler to an element (shorthand for addListener)",
150       "sig" : "(element, eventName, handler, scope, options)",
151       "static" : true,
152       "memberOf" : "",
153       "isStatic" : true,
154       "isConstructor" : false,
155       "isPrivate" : false,
156       "example" : "",
157       "deprecated" : "",
158       "since" : "",
159       "see" : "",
160       "exceptions" : "",
161       "requires" : "",
162       "params" : [
163         {
164           "name" : "element",
165           "type" : "String/HTMLElement",
166           "desc" : "The html element or id to assign the",
167           "isOptional" : false
168         },
169         {
170           "name" : "eventName",
171           "type" : "String",
172           "desc" : "The type of event to listen for",
173           "isOptional" : false
174         },
175         {
176           "name" : "handler",
177           "type" : "Function",
178           "desc" : "The method the event invokes",
179           "isOptional" : false
180         },
181         {
182           "name" : "scope",
183           "type" : "Object",
184           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
185           "isOptional" : false
186         },
187         {
188           "name" : "options",
189           "type" : "Object",
190           "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:<ul>\n<li>scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.</li>\n<li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li>\n<li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li>\n<li>preventDefault {Boolean} True to prevent the default action</li>\n<li>stopPropagation {Boolean} True to prevent event propagation</li>\n<li>normalized {Boolean} False to pass a browser event to the handler function instead of an Roo.EventObject</li>\n<li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>\n<li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>\n<li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>\n</ul><br>\n<p>\n<b>Combining Options</b><br>\nUsing the options argument, it is possible to combine different types of listeners:<br>\n<br>\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style=\"margin: 5px 20px 20px;\">\nCode:<pre><code>\nel.on('click', this.onClick, this, {\n    single: true,\n    delay: 100,\n    stopEvent : true,\n    forumId: 4\n});</code></pre>\n<p>\n<b>Attaching multiple handlers in 1 call</b><br>\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n<p>\nCode:<pre><code>\nel.on({\n    'click' : {\n        fn: this.onClick\n        scope: this,\n        delay: 100\n    },\n    'mouseover' : {\n        fn: this.onMouseOver\n        scope: this\n    },\n    'mouseout' : {\n        fn: this.onMouseOut\n        scope: this\n    }\n});</code></pre>\n<p>\nOr a shorthand syntax:<br>\nCode:<pre><code>\nel.on({\n    'click' : this.onClick,\n    'mouseover' : this.onMouseOver,\n    'mouseout' : this.onMouseOut\n    scope: this\n});</code></pre>",
191           "isOptional" : false
192         }
193       ],
194       "returns" : []
195     },
196     {
197       "name" : "removeResizeListener",
198       "type" : "function",
199       "desc" : "Removes the passed window resize listener.",
200       "sig" : "(fn, scope)",
201       "static" : true,
202       "memberOf" : "",
203       "isStatic" : true,
204       "isConstructor" : false,
205       "isPrivate" : false,
206       "example" : "",
207       "deprecated" : "",
208       "since" : "",
209       "see" : "",
210       "exceptions" : "",
211       "requires" : "",
212       "params" : [
213         {
214           "name" : "fn",
215           "type" : "Function",
216           "desc" : "The method the event invokes",
217           "isOptional" : false
218         },
219         {
220           "name" : "scope",
221           "type" : "Object",
222           "desc" : "The scope of handler",
223           "isOptional" : false
224         }
225       ],
226       "returns" : []
227     },
228     {
229       "name" : "onWindowResize",
230       "type" : "function",
231       "desc" : "Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers.",
232       "sig" : "(fn, scope, options)",
233       "static" : true,
234       "memberOf" : "",
235       "isStatic" : true,
236       "isConstructor" : false,
237       "isPrivate" : false,
238       "example" : "",
239       "deprecated" : "",
240       "since" : "",
241       "see" : "",
242       "exceptions" : "",
243       "requires" : "",
244       "params" : [
245         {
246           "name" : "fn",
247           "type" : "Function",
248           "desc" : "The method the event invokes",
249           "isOptional" : false
250         },
251         {
252           "name" : "scope",
253           "type" : "Object",
254           "desc" : "An object that becomes the scope of the handler",
255           "isOptional" : false
256         },
257         {
258           "name" : "options",
259           "type" : "boolean",
260           "desc" : "",
261           "isOptional" : false
262         }
263       ],
264       "returns" : []
265     },
266     {
267       "name" : "wrap",
268       "type" : "function",
269       "desc" : "This is no longer needed and is deprecated. Places a simple wrapper around an event handler to override the browser event\nobject with a Roo.EventObject",
270       "sig" : "(fn, scope, override)",
271       "static" : true,
272       "memberOf" : "",
273       "isStatic" : true,
274       "isConstructor" : false,
275       "isPrivate" : false,
276       "example" : "",
277       "deprecated" : "This has been deprecated: ",
278       "since" : "",
279       "see" : "",
280       "exceptions" : "",
281       "requires" : "",
282       "params" : [
283         {
284           "name" : "fn",
285           "type" : "Function",
286           "desc" : "The method the event invokes",
287           "isOptional" : false
288         },
289         {
290           "name" : "scope",
291           "type" : "Object",
292           "desc" : "An object that becomes the scope of the handler",
293           "isOptional" : false
294         },
295         {
296           "name" : "override",
297           "type" : "boolean",
298           "desc" : "If true, the obj passed in becomes\n                            the execution scope of the listener",
299           "isOptional" : false
300         }
301       ],
302       "returns" : [
303         {
304           "name" : "",
305           "type" : "Function",
306           "desc" : "The wrapped function"
307         }
308       ]
309     },
310     {
311       "name" : "removeListener",
312       "type" : "function",
313       "desc" : "Removes an event handler",
314       "sig" : "(element, eventName, fn)",
315       "static" : true,
316       "memberOf" : "",
317       "isStatic" : true,
318       "isConstructor" : false,
319       "isPrivate" : false,
320       "example" : "",
321       "deprecated" : "",
322       "since" : "",
323       "see" : "",
324       "exceptions" : "",
325       "requires" : "",
326       "params" : [
327         {
328           "name" : "element",
329           "type" : "String/HTMLElement",
330           "desc" : "The id or html element to remove the \n                            event from",
331           "isOptional" : false
332         },
333         {
334           "name" : "eventName",
335           "type" : "String",
336           "desc" : "The type of event",
337           "isOptional" : false
338         },
339         {
340           "name" : "fn",
341           "type" : "Function",
342           "desc" : "",
343           "isOptional" : false
344         }
345       ],
346       "returns" : [
347         {
348           "name" : "",
349           "type" : "Boolean",
350           "desc" : "True if a listener was actually removed"
351         }
352       ]
353     }
354   ],
355   "events" : []
356 }