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