Partial Fix #5654 - roojspacker - get it working as a doc tool...
[roojs1] / docs2 / symbols / Roo.util.Observable.json
1 {
2   "name" : "Roo.util.Observable",
3   "augments" : [
4   ],
5   "desc" : "Base class that provides a common interface for publishing events. Subclasses are expected to\nto have a property \"events\" with all the events defined.<br>\nFor example:\n<pre><code>\n Employee = function(name){\n    this.name = name;\n    this.addEvents({\n        \"fired\" : true,\n        \"quit\" : true\n    });\n }\n Roo.extend(Employee, Roo.util.Observable);\n</code></pre>",
6   "isSingleton" : false,
7   "isStatic" : true,
8   "isBuiltin" : false,
9   "config" : [
10     {
11       "name" : "listeners",
12       "type" : "Object",
13       "desc" : "list of events and functions to call for this object, \nFor example :\n<pre><code>\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  </code></pre>",
14       "memberOf" : "Roo.util.Observable",
15       "values" : [
16       ]
17     }
18   ],
19   "methods" : [
20     {
21       "name" : "purgeListeners",
22       "desc" : "Removes all listeners for this object",
23       "isStatic" : false,
24       "isConstructor" : false,
25       "isPrivate" : false,
26       "memberOf" : "Roo.util.Observable",
27       "example" : "",
28       "deprecated" : "",
29       "since" : "",
30       "see" : "",
31       "params" : [
32       ],
33       "returns" : [
34       ]
35     },
36     {
37       "name" : "on",
38       "desc" : "Appends an event handler to this element (shorthand for addListener)",
39       "isStatic" : false,
40       "isConstructor" : false,
41       "isPrivate" : false,
42       "memberOf" : "Roo.util.Observable",
43       "example" : "",
44       "deprecated" : "",
45       "since" : "",
46       "see" : "",
47       "params" : [
48         {
49           "name" : "eventName",
50           "type" : "String",
51           "desc" : "The type of event to listen for",
52           "isOptional" : false
53         },
54         {
55           "name" : "handler",
56           "type" : "Function",
57           "desc" : "The method the event invokes",
58           "isOptional" : false
59         },
60         {
61           "name" : "scope",
62           "type" : "Object",
63           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
64           "isOptional" : false
65         },
66         {
67           "name" : "options",
68           "type" : "Object",
69           "desc" : "(optional)",
70           "isOptional" : false
71         }
72       ],
73       "returns" : [
74       ]
75     },
76     {
77       "name" : "un",
78       "desc" : "Removes a listener (shorthand for removeListener)",
79       "isStatic" : false,
80       "isConstructor" : false,
81       "isPrivate" : false,
82       "memberOf" : "Roo.util.Observable",
83       "example" : "",
84       "deprecated" : "",
85       "since" : "",
86       "see" : "",
87       "params" : [
88         {
89           "name" : "eventName",
90           "type" : "String",
91           "desc" : "The type of event to listen for",
92           "isOptional" : false
93         },
94         {
95           "name" : "handler",
96           "type" : "Function",
97           "desc" : "The handler to remove",
98           "isOptional" : false
99         },
100         {
101           "name" : "scope",
102           "type" : "Object",
103           "desc" : "(optional) The scope (this object) for the handler",
104           "isOptional" : false
105         }
106       ],
107       "returns" : [
108       ]
109     },
110     {
111       "name" : "addEvents",
112       "desc" : "Used to define events on this Observable",
113       "isStatic" : false,
114       "isConstructor" : false,
115       "isPrivate" : false,
116       "memberOf" : "Roo.util.Observable",
117       "example" : "",
118       "deprecated" : "",
119       "since" : "",
120       "see" : "",
121       "params" : [
122         {
123           "name" : "object",
124           "type" : "Object",
125           "desc" : "The object with the events defined",
126           "isOptional" : false
127         }
128       ],
129       "returns" : [
130       ]
131     },
132     {
133       "name" : "releaseCapture",
134       "desc" : "Removes <b>all</b> added captures from the Observable.",
135       "isStatic" : true,
136       "isConstructor" : false,
137       "isPrivate" : false,
138       "memberOf" : "Roo.util.Observable",
139       "example" : "",
140       "deprecated" : "",
141       "since" : "",
142       "see" : "",
143       "params" : [
144         {
145           "name" : "o",
146           "type" : "Observable",
147           "desc" : "The Observable to release",
148           "isOptional" : false
149         }
150       ],
151       "returns" : [
152       ]
153     },
154     {
155       "name" : "removeListener",
156       "desc" : "Removes a listener",
157       "isStatic" : false,
158       "isConstructor" : false,
159       "isPrivate" : false,
160       "memberOf" : "Roo.util.Observable",
161       "example" : "",
162       "deprecated" : "",
163       "since" : "",
164       "see" : "",
165       "params" : [
166         {
167           "name" : "eventName",
168           "type" : "String",
169           "desc" : "The type of event to listen for",
170           "isOptional" : false
171         },
172         {
173           "name" : "handler",
174           "type" : "Function",
175           "desc" : "The handler to remove",
176           "isOptional" : false
177         },
178         {
179           "name" : "scope",
180           "type" : "Object",
181           "desc" : "(optional) The scope (this object) for the handler",
182           "isOptional" : false
183         }
184       ],
185       "returns" : [
186       ]
187     },
188     {
189       "name" : "fireEvent",
190       "desc" : "Fires the specified event with the passed parameters (minus the event name).",
191       "isStatic" : false,
192       "isConstructor" : false,
193       "isPrivate" : false,
194       "memberOf" : "Roo.util.Observable",
195       "example" : "",
196       "deprecated" : "",
197       "since" : "",
198       "see" : "",
199       "params" : [
200         {
201           "name" : "eventName",
202           "type" : "String",
203           "desc" : "",
204           "isOptional" : false
205         },
206         {
207           "name" : "args",
208           "type" : "Object...",
209           "desc" : "Variable number of parameters are passed to handlers",
210           "isOptional" : false
211         }
212       ],
213       "returns" : [
214         {
215           "name" : "",
216           "type" : "Boolean",
217           "desc" : "returns false if any of the handlers return false otherwise it returns true"
218         }
219       ]
220     },
221     {
222       "name" : "hasListener",
223       "desc" : "Checks to see if this object has any listeners for a specified event",
224       "isStatic" : false,
225       "isConstructor" : false,
226       "isPrivate" : false,
227       "memberOf" : "Roo.util.Observable",
228       "example" : "",
229       "deprecated" : "",
230       "since" : "",
231       "see" : "",
232       "params" : [
233         {
234           "name" : "eventName",
235           "type" : "String",
236           "desc" : "The name of the event to check for",
237           "isOptional" : false
238         }
239       ],
240       "returns" : [
241         {
242           "name" : "",
243           "type" : "Boolean",
244           "desc" : "True if the event is being listened for, else false"
245         }
246       ]
247     },
248     {
249       "name" : "capture",
250       "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\n<b>before</b> the event is fired. If the supplied function returns false,\nthe event will not fire.",
251       "isStatic" : true,
252       "isConstructor" : false,
253       "isPrivate" : false,
254       "memberOf" : "Roo.util.Observable",
255       "example" : "",
256       "deprecated" : "",
257       "since" : "",
258       "see" : "",
259       "params" : [
260         {
261           "name" : "o",
262           "type" : "Observable",
263           "desc" : "The Observable to capture",
264           "isOptional" : false
265         },
266         {
267           "name" : "fn",
268           "type" : "Function",
269           "desc" : "The function to call",
270           "isOptional" : false
271         },
272         {
273           "name" : "scope",
274           "type" : "Object",
275           "desc" : "(optional) The scope (this object) for the fn",
276           "isOptional" : false
277         }
278       ],
279       "returns" : [
280       ]
281     },
282     {
283       "name" : "addListener",
284       "desc" : "Appends an event handler to this component",
285       "isStatic" : false,
286       "isConstructor" : false,
287       "isPrivate" : false,
288       "memberOf" : "Roo.util.Observable",
289       "example" : "",
290       "deprecated" : "",
291       "since" : "",
292       "see" : "",
293       "params" : [
294         {
295           "name" : "eventName",
296           "type" : "String",
297           "desc" : "The type of event to listen for",
298           "isOptional" : false
299         },
300         {
301           "name" : "handler",
302           "type" : "Function",
303           "desc" : "The method the event invokes",
304           "isOptional" : false
305         },
306         {
307           "name" : "scope",
308           "type" : "Object",
309           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
310           "isOptional" : false
311         },
312         {
313           "name" : "options",
314           "type" : "Object",
315           "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>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)\n\t\t<pre><code>\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t</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<pre><code>\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t</code></pre>\n<p>\nOr a shorthand syntax which passes the same scope object to all handlers:\n     \t<pre><code>\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t</code></pre>",
316           "isOptional" : false
317         }
318       ],
319       "returns" : [
320       ]
321     }
322   ],
323   "events" : [
324   ]
325 }