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