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