sync
[roojs1] / docs / symbols / Roo.EventManager.json
1 {
2   "name" : "Roo.EventManager",
3   "augments" : [],
4   "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.",
5   "isSingleton" : true,
6   "isStatic" : false,
7   "isBuiltin" : false,
8   "memberOf" : "EventManager",
9   "example" : "",
10   "deprecated" : "",
11   "since" : "",
12   "see" : "",
13   "params" : [],
14   "returns" : [],
15   "throws" : "",
16   "requires" : "",
17   "config" : [],
18   "methods" : [
19     {
20       "name" : "addListener",
21       "type" : "function",
22       "desc" : "Appends an event handler to an element (shorthand for addListener)",
23       "sig" : "(element, eventName, handler, scope, options)",
24       "static" : true,
25       "memberOf" : "",
26       "isStatic" : true,
27       "isConstructor" : false,
28       "isPrivate" : false,
29       "example" : "",
30       "deprecated" : "",
31       "since" : "",
32       "see" : "",
33       "exceptions" : "",
34       "requires" : "",
35       "params" : [
36         {
37           "name" : "element",
38           "type" : "String/HTMLElement",
39           "desc" : "The html element or id to assign the",
40           "isOptional" : false
41         },
42         {
43           "name" : "eventName",
44           "type" : "String",
45           "desc" : "The type of event to listen for",
46           "isOptional" : false
47         },
48         {
49           "name" : "handler",
50           "type" : "Function",
51           "desc" : "The method the event invokes",
52           "isOptional" : false
53         },
54         {
55           "name" : "scope",
56           "type" : "Object",
57           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
58           "isOptional" : false
59         },
60         {
61           "name" : "options",
62           "type" : "Object",
63           "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>",
64           "isOptional" : false
65         }
66       ],
67       "returns" : []
68     },
69     {
70       "name" : "onDocumentReady",
71       "type" : "function",
72       "desc" : "Fires when the document is ready (before onload and before images are loaded). Can be \naccessed shorthanded Roo.onReady().",
73       "sig" : "(fn, scope, options)",
74       "static" : true,
75       "memberOf" : "",
76       "isStatic" : true,
77       "isConstructor" : false,
78       "isPrivate" : false,
79       "example" : "",
80       "deprecated" : "",
81       "since" : "",
82       "see" : "",
83       "exceptions" : "",
84       "requires" : "",
85       "params" : [
86         {
87           "name" : "fn",
88           "type" : "Function",
89           "desc" : "The method the event invokes",
90           "isOptional" : false
91         },
92         {
93           "name" : "scope",
94           "type" : "Object",
95           "desc" : "An  object that becomes the scope of the handler",
96           "isOptional" : false
97         },
98         {
99           "name" : "options",
100           "type" : "boolean",
101           "desc" : "",
102           "isOptional" : false
103         }
104       ],
105       "returns" : []
106     },
107     {
108       "name" : "onTextResize",
109       "type" : "function",
110       "desc" : "Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.",
111       "sig" : "(fn, scope, options)",
112       "static" : true,
113       "memberOf" : "",
114       "isStatic" : true,
115       "isConstructor" : false,
116       "isPrivate" : false,
117       "example" : "",
118       "deprecated" : "",
119       "since" : "",
120       "see" : "",
121       "exceptions" : "",
122       "requires" : "",
123       "params" : [
124         {
125           "name" : "fn",
126           "type" : "Function",
127           "desc" : "The method the event invokes",
128           "isOptional" : false
129         },
130         {
131           "name" : "scope",
132           "type" : "Object",
133           "desc" : "An object that becomes the scope of the handler",
134           "isOptional" : false
135         },
136         {
137           "name" : "options",
138           "type" : "boolean",
139           "desc" : "",
140           "isOptional" : false
141         }
142       ],
143       "returns" : []
144     },
145     {
146       "name" : "on",
147       "type" : "function",
148       "desc" : "Appends an event handler to an element (shorthand for addListener)",
149       "sig" : "(element, eventName, handler, scope, options)",
150       "static" : true,
151       "memberOf" : "",
152       "isStatic" : true,
153       "isConstructor" : false,
154       "isPrivate" : false,
155       "example" : "",
156       "deprecated" : "",
157       "since" : "",
158       "see" : "",
159       "exceptions" : "",
160       "requires" : "",
161       "params" : [
162         {
163           "name" : "element",
164           "type" : "String/HTMLElement",
165           "desc" : "The html element or id to assign the",
166           "isOptional" : false
167         },
168         {
169           "name" : "eventName",
170           "type" : "String",
171           "desc" : "The type of event to listen for",
172           "isOptional" : false
173         },
174         {
175           "name" : "handler",
176           "type" : "Function",
177           "desc" : "The method the event invokes",
178           "isOptional" : false
179         },
180         {
181           "name" : "scope",
182           "type" : "Object",
183           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
184           "isOptional" : false
185         },
186         {
187           "name" : "options",
188           "type" : "Object",
189           "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>",
190           "isOptional" : false
191         }
192       ],
193       "returns" : []
194     },
195     {
196       "name" : "removeResizeListener",
197       "type" : "function",
198       "desc" : "Removes the passed window resize listener.",
199       "sig" : "(fn, scope)",
200       "static" : true,
201       "memberOf" : "",
202       "isStatic" : true,
203       "isConstructor" : false,
204       "isPrivate" : false,
205       "example" : "",
206       "deprecated" : "",
207       "since" : "",
208       "see" : "",
209       "exceptions" : "",
210       "requires" : "",
211       "params" : [
212         {
213           "name" : "fn",
214           "type" : "Function",
215           "desc" : "The method the event invokes",
216           "isOptional" : false
217         },
218         {
219           "name" : "scope",
220           "type" : "Object",
221           "desc" : "The scope of handler",
222           "isOptional" : false
223         }
224       ],
225       "returns" : []
226     },
227     {
228       "name" : "onWindowResize",
229       "type" : "function",
230       "desc" : "Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers.",
231       "sig" : "(fn, scope, options)",
232       "static" : true,
233       "memberOf" : "",
234       "isStatic" : true,
235       "isConstructor" : false,
236       "isPrivate" : false,
237       "example" : "",
238       "deprecated" : "",
239       "since" : "",
240       "see" : "",
241       "exceptions" : "",
242       "requires" : "",
243       "params" : [
244         {
245           "name" : "fn",
246           "type" : "Function",
247           "desc" : "The method the event invokes",
248           "isOptional" : false
249         },
250         {
251           "name" : "scope",
252           "type" : "Object",
253           "desc" : "An object that becomes the scope of the handler",
254           "isOptional" : false
255         },
256         {
257           "name" : "options",
258           "type" : "boolean",
259           "desc" : "",
260           "isOptional" : false
261         }
262       ],
263       "returns" : []
264     },
265     {
266       "name" : "wrap",
267       "type" : "function",
268       "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",
269       "sig" : "(fn, scope, override)",
270       "static" : true,
271       "memberOf" : "",
272       "isStatic" : true,
273       "isConstructor" : false,
274       "isPrivate" : false,
275       "example" : "",
276       "deprecated" : "This has been deprecated: ",
277       "since" : "",
278       "see" : "",
279       "exceptions" : "",
280       "requires" : "",
281       "params" : [
282         {
283           "name" : "fn",
284           "type" : "Function",
285           "desc" : "The method the event invokes",
286           "isOptional" : false
287         },
288         {
289           "name" : "scope",
290           "type" : "Object",
291           "desc" : "An object that becomes the scope of the handler",
292           "isOptional" : false
293         },
294         {
295           "name" : "override",
296           "type" : "boolean",
297           "desc" : "If true, the obj passed in becomes\n                            the execution scope of the listener",
298           "isOptional" : false
299         }
300       ],
301       "returns" : [
302         {
303           "name" : "",
304           "type" : "Function",
305           "desc" : "The wrapped function"
306         }
307       ]
308     },
309     {
310       "name" : "removeListener",
311       "type" : "function",
312       "desc" : "Removes an event handler",
313       "sig" : "(element, eventName, fn)",
314       "static" : true,
315       "memberOf" : "",
316       "isStatic" : true,
317       "isConstructor" : false,
318       "isPrivate" : false,
319       "example" : "",
320       "deprecated" : "",
321       "since" : "",
322       "see" : "",
323       "exceptions" : "",
324       "requires" : "",
325       "params" : [
326         {
327           "name" : "element",
328           "type" : "String/HTMLElement",
329           "desc" : "The id or html element to remove the \n                            event from",
330           "isOptional" : false
331         },
332         {
333           "name" : "eventName",
334           "type" : "String",
335           "desc" : "The type of event",
336           "isOptional" : false
337         },
338         {
339           "name" : "fn",
340           "type" : "Function",
341           "desc" : "",
342           "isOptional" : false
343         }
344       ],
345       "returns" : [
346         {
347           "name" : "",
348           "type" : "Boolean",
349           "desc" : "True if a listener was actually removed"
350         }
351       ]
352     }
353   ],
354   "events" : []
355 }