1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.util.ClickRepeater-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.util.ClickRepeater-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.util.ClickRepeater-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.util.ClickRepeater-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7 <a class="bookmark" href="../docs/?class=Ext.util.ClickRepeater"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
9 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a>
11 <img src="resources/elbow-end.gif"/>ClickRepeater</pre></div>
12 <h1>Class Ext.util.ClickRepeater</h1>
13 <table cellspacing="0">
14 <tr><td class="label">Package:</td><td class="hd-info">Ext.util</td></tr>
15 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/ClickRepeater.js" target="_blank">ClickRepeater.js</a></td></tr>
16 <tr><td class="label">Class:</td><td class="hd-info">ClickRepeater</td></tr>
17 <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a></td></tr>
19 <div class="description">
22 A wrapper class which can be applied to any element. Fires a "click" event while the
\r
23 mouse is pressed. The interval between firings may be specified in the config but
\r
24 defaults to 20 milliseconds.
\r
26 Optionally, a CSS class may be applied to the element during the time it is pressed. </div>
28 <div class="hr"></div>
29 <a id="Ext.util.ClickRepeater-configs"></a>
30 <h2>Config Options</h2>
31 <table cellspacing="0" class="member-table">
33 <th class="sig-header" colspan="2">Config Options</th>
34 <th class="msource-header">Defined By</th>
36 <tr class="config-row">
\r
37 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
39 <a id="Ext.util.ClickRepeater-accelerate"></a>
\r
40 <b>accelerate</b> : Boolean <div class="mdesc">
\r
41 True if autorepeating should start slowly and accelerate. "interval" and "delay" are ignored. </div>
\r
43 <td class="msource">ClickRepeater</td>
\r
45 <tr class="config-row alt">
\r
46 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
48 <a id="Ext.util.ClickRepeater-delay"></a>
\r
49 <b>delay</b> : Number <div class="mdesc">
\r
50 The initial delay before the repeating event begins firing. Similar to an autorepeat key delay. </div>
\r
52 <td class="msource">ClickRepeater</td>
\r
54 <tr class="config-row">
\r
55 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
57 <a id="Ext.util.ClickRepeater-el"></a>
\r
58 <b>el</b> : Mixed <div class="mdesc">
\r
59 The element to act as a button. </div>
\r
61 <td class="msource">ClickRepeater</td>
\r
63 <tr class="config-row alt">
\r
64 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
66 <a id="Ext.util.ClickRepeater-interval"></a>
\r
67 <b>interval</b> : Number <div class="mdesc">
\r
68 The interval between firings of the "click" event. Default 20 ms. </div>
\r
70 <td class="msource">ClickRepeater</td>
\r
72 <tr class="config-row inherited expandable">
\r
73 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
75 <a id="Ext.util.ClickRepeater-listeners"></a>
\r
76 <b>listeners</b> : Object <div class="mdesc">
\r
77 <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
\r
79 (optional) A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the <a ext:cls="Ext.util.Observable" ext:member="addListener" href="output/Ext.util.Observable.html#addListener">addListener</a> example for attaching multiple handlers at once. </div>
\r
82 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
\r
84 <tr class="config-row alt">
\r
85 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
87 <a id="Ext.util.ClickRepeater-pressClass"></a>
\r
88 <b>pressClass</b> : String <div class="mdesc">
\r
89 A CSS class name to be applied to the element while pressed. </div>
\r
91 <td class="msource">ClickRepeater</td>
\r
93 <tr class="config-row">
\r
94 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
96 <a id="Ext.util.ClickRepeater-preventDefault"></a>
\r
97 <b>preventDefault</b> : Boolean <div class="mdesc">
\r
98 True to prevent the default click event </div>
\r
100 <td class="msource">ClickRepeater</td>
\r
102 <tr class="config-row alt">
\r
103 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
105 <a id="Ext.util.ClickRepeater-stopDefault"></a>
\r
106 <b>stopDefault</b> : Boolean <div class="mdesc">
\r
107 True to stop the default click event </div>
\r
109 <td class="msource">ClickRepeater</td>
\r
112 <a id="Ext.util.ClickRepeater-props"></a>
113 <h2>Public Properties</h2>
114 <div class="no-members">This class has no public properties.</div> <a id="Ext.util.ClickRepeater-methods"></a>
115 <h2>Public Methods</h2>
116 <table cellspacing="0" class="member-table">
118 <th class="sig-header" colspan="2">Method</th>
119 <th class="msource-header">Defined By</th>
121 <tr class="method-row expandable">
\r
122 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
124 <a id="Ext.util.ClickRepeater-ClickRepeater"></a>
\r
125 <b>ClickRepeater</b>( <code>Mixed el</code>, <code>Object config</code> ) <div class="mdesc">
\r
126 <div class="short"></div>
\r
128 <div class="mdetail-params">
\r
129 <strong>Parameters:</strong>
\r
130 <ul><li><code>el</code> : Mixed<div class="sub-desc">The element to listen on</div></li><li><code>config</code> : Object<div class="sub-desc"></div></li> </ul>
\r
131 <strong>Returns:</strong>
\r
133 <li><code></code></li>
\r
139 <td class="msource">ClickRepeater</td>
\r
141 <tr class="method-row inherited alt expandable">
\r
142 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
144 <a id="Ext.util.ClickRepeater-addEvents"></a>
\r
145 <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
\r
146 <div class="short">Used to define events on this Observable</div>
\r
148 Used to define events on this Observable <div class="mdetail-params">
\r
149 <strong>Parameters:</strong>
\r
150 <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
\r
151 <strong>Returns:</strong>
\r
153 <li><code>void</code></li>
\r
159 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
\r
161 <tr class="method-row inherited expandable">
\r
162 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
164 <a id="Ext.util.ClickRepeater-addListener"></a>
\r
165 <b>addListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
166 <div class="short">Appends an event handler to this component</div>
\r
168 Appends an event handler to this component <div class="mdetail-params">
\r
169 <strong>Parameters:</strong>
\r
170 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
171 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
172 properties. This may contain any of the following properties:<ul>
173 <li><b>scope</b> : Object<p class="sub-desc">The scope in which to execute the handler function. The handler function's "this" context.</p></li>
174 <li><b>delay</b> : Number<p class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</p></li>
175 <li><b>single</b> : Boolean<p class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</p></li>
176 <li><b>buffer</b> : Number<p class="sub-desc">Causes the handler to be scheduled to run in an <a ext:cls="Ext.util.DelayedTask" href="output/Ext.util.DelayedTask.html">Ext.util.DelayedTask</a> delayed
177 by the specified number of milliseconds. If the event fires again within that time, the original
178 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
181 <b>Combining Options</b><br>
182 Using the options argument, it is possible to combine different types of listeners:<br>
184 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
185 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
191 <b>Attaching multiple handlers in 1 call</b><br>
192 The method also allows for a single argument to be passed which is a config object containing properties
193 which specify multiple handlers.
197 fn: <b>this</b>.onClick,
201 <em>'mouseover'</em> : {
202 fn: <b>this</b>.onMouseOver,
205 <em>'mouseout'</em> : {
206 fn: <b>this</b>.onMouseOut,
211 Or a shorthand syntax:<br>
213 <em>'click'</em> : <b>this</b>.onClick,
214 <em>'mouseover'</em> : <b>this</b>.onMouseOver,
215 <em>'mouseout'</em> : <b>this</b>.onMouseOut,
217 });</code></pre></div></li> </ul>
\r
218 <strong>Returns:</strong>
\r
220 <li><code>void</code></li>
\r
226 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
\r
228 <tr class="method-row inherited alt expandable">
\r
229 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
231 <a id="Ext.util.ClickRepeater-fireEvent"></a>
\r
232 <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc">
\r
233 <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
\r
235 Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params">
\r
236 <strong>Parameters:</strong>
\r
237 <ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li> </ul>
\r
238 <strong>Returns:</strong>
\r
240 <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
\r
246 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
\r
248 <tr class="method-row inherited expandable">
\r
249 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
251 <a id="Ext.util.ClickRepeater-hasListener"></a>
\r
252 <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc">
\r
253 <div class="short">Checks to see if this object has any listeners for a specified event</div>
\r
255 Checks to see if this object has any listeners for a specified event <div class="mdetail-params">
\r
256 <strong>Parameters:</strong>
\r
257 <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
\r
258 <strong>Returns:</strong>
\r
260 <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
\r
266 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
\r
268 <tr class="method-row inherited alt expandable">
\r
269 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
271 <a id="Ext.util.ClickRepeater-on"></a>
\r
272 <b>on</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
273 <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
\r
275 Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params">
\r
276 <strong>Parameters:</strong>
\r
277 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
278 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
\r
279 <strong>Returns:</strong>
\r
281 <li><code>void</code></li>
\r
287 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
\r
289 <tr class="method-row inherited expandable">
\r
290 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
292 <a id="Ext.util.ClickRepeater-purgeListeners"></a>
\r
293 <b>purgeListeners</b>() : void <div class="mdesc">
\r
294 <div class="short">Removes all listeners for this object</div>
\r
296 Removes all listeners for this object <div class="mdetail-params">
\r
297 <strong>Parameters:</strong>
\r
298 <ul><li>None.</li> </ul>
\r
299 <strong>Returns:</strong>
\r
301 <li><code>void</code></li>
\r
307 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
\r
309 <tr class="method-row inherited alt expandable">
\r
310 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
312 <a id="Ext.util.ClickRepeater-relayEvents"></a>
\r
313 <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc">
\r
314 <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
\r
316 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params">
\r
317 <strong>Parameters:</strong>
\r
318 <ul><li><code>o</code> : Object<div class="sub-desc">The Observable whose events this object is to relay.</div></li><li><code>events</code> : Array<div class="sub-desc">Array of event names to relay.</div></li> </ul>
\r
319 <strong>Returns:</strong>
\r
321 <li><code>void</code></li>
\r
327 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
\r
329 <tr class="method-row inherited expandable">
\r
330 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
332 <a id="Ext.util.ClickRepeater-removeListener"></a>
\r
333 <b>removeListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
334 <div class="short">Removes a listener</div>
\r
336 Removes a listener <div class="mdetail-params">
\r
337 <strong>Parameters:</strong>
\r
338 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
339 <strong>Returns:</strong>
\r
341 <li><code>void</code></li>
\r
347 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
\r
349 <tr class="method-row inherited alt expandable">
\r
350 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
352 <a id="Ext.util.ClickRepeater-resumeEvents"></a>
\r
353 <b>resumeEvents</b>() : void <div class="mdesc">
\r
354 <div class="short">Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>)</div>
\r
356 Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>) <div class="mdetail-params">
\r
357 <strong>Parameters:</strong>
\r
358 <ul><li>None.</li> </ul>
\r
359 <strong>Returns:</strong>
\r
361 <li><code>void</code></li>
\r
367 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
\r
369 <tr class="method-row inherited expandable">
\r
370 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
372 <a id="Ext.util.ClickRepeater-suspendEvents"></a>
\r
373 <b>suspendEvents</b>() : void <div class="mdesc">
\r
374 <div class="short">Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>)</div>
\r
376 Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>) <div class="mdetail-params">
\r
377 <strong>Parameters:</strong>
\r
378 <ul><li>None.</li> </ul>
\r
379 <strong>Returns:</strong>
\r
381 <li><code>void</code></li>
\r
387 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
\r
389 <tr class="method-row inherited alt expandable">
\r
390 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
392 <a id="Ext.util.ClickRepeater-un"></a>
\r
393 <b>un</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
394 <div class="short">Removes a listener (shorthand for removeListener)</div>
\r
396 Removes a listener (shorthand for removeListener) <div class="mdetail-params">
\r
397 <strong>Parameters:</strong>
\r
398 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
399 <strong>Returns:</strong>
\r
401 <li><code>void</code></li>
\r
407 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
\r
410 <a id="Ext.util.ClickRepeater-events"></a>
411 <h2>Public Events</h2>
412 <table cellspacing="0" class="member-table">
414 <th class="sig-header" colspan="2">Event</th>
415 <th class="msource-header">Defined By</th>
417 <tr class="event-row expandable">
\r
418 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
420 <a id="Ext.util.ClickRepeater-click"></a>
\r
421 <b>click</b> : ( <code>Ext.util.ClickRepeater this</code> ) <div class="mdesc">
\r
422 <div class="short">Fires on a specified interval during the time the element is pressed.</div>
\r
424 Fires on a specified interval during the time the element is pressed. <div class="mdetail-params">
\r
425 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
426 <ul><li><code>this</code> : Ext.util.ClickRepeater<div class="sub-desc"></div></li> </ul>
\r
431 <td class="msource">ClickRepeater</td>
\r
433 <tr class="event-row alt expandable">
\r
434 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
436 <a id="Ext.util.ClickRepeater-mousedown"></a>
\r
437 <b>mousedown</b> : ( <code>Ext.util.ClickRepeater this</code> ) <div class="mdesc">
\r
438 <div class="short">Fires when the mouse button is depressed.</div>
\r
440 Fires when the mouse button is depressed. <div class="mdetail-params">
\r
441 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
442 <ul><li><code>this</code> : Ext.util.ClickRepeater<div class="sub-desc"></div></li> </ul>
\r
447 <td class="msource">ClickRepeater</td>
\r
449 <tr class="event-row expandable">
\r
450 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
452 <a id="Ext.util.ClickRepeater-mouseup"></a>
\r
453 <b>mouseup</b> : ( <code>Ext.util.ClickRepeater this</code> ) <div class="mdesc">
\r
454 <div class="short">Fires when the mouse key is released.</div>
\r
456 Fires when the mouse key is released. <div class="mdetail-params">
\r
457 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
458 <ul><li><code>this</code> : Ext.util.ClickRepeater<div class="sub-desc"></div></li> </ul>
\r
463 <td class="msource">ClickRepeater</td>
\r