1 <div xmlns:ext="http://www.extjs.com" class="body-wrap"><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.TaskRunner.html" ext:member="" ext:cls="Ext.util.TaskRunner">TaskRunner</a> <img src="resources/elbow-end.gif">TaskMgr</pre></div><h1>Class <a href="source/TaskMgr.html#cls-Ext.TaskMgr">Ext.TaskMgr</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">TaskMgr.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/TaskMgr.html#cls-Ext.TaskMgr">TaskMgr</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.util.TaskRunner.html" ext:cls="Ext.util.TaskRunner" ext:member="">TaskRunner</a></td></tr></table><div class="description">A static <a href="output/Ext.util.TaskRunner.html" ext:cls="Ext.util.TaskRunner">Ext.util.TaskRunner</a> instance that can be used to start and stop arbitrary tasks. See
2 <a href="output/Ext.util.TaskRunner.html" ext:cls="Ext.util.TaskRunner">Ext.util.TaskRunner</a> for supported methods and task config properties.
3 <pre><code><i>// Start a simple clock task that updates a div once per second</i>
5 run: <b>function</b>(){
6 Ext.fly(<em>'clock'</em>).update(<b>new</b> Date().format(<em>'g:i:s A'</em>));
8 interval: 1000 <i>//1 second</i>
10 Ext.TaskMgr.start(task);</code></pre><br><br><i>This class is a singleton and cannot be created directly.</i></div><div class="hr"></div><a id="Ext.TaskMgr-props"></a><h2>Public Properties</h2><div class="no-members">This class has no public properties.</div><a id="Ext.TaskMgr-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.TaskRunner-start"></a><b><a href="source/TaskMgr.html#method-Ext.util.TaskRunner-start">start</a></b>( <code>Object task</code> )
12 Object<div class="mdesc"><div class="short">Starts a new task.</div><div class="long">Starts a new task.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>task</code> : Object<div class="sub-desc">A config object that supports the following properties:<ul>
13 <li><code>run</code> : Function<div class="sub-desc">The function to execute each time the task is run. The
14 function will be called at each interval and passed the <code>args</code> argument if specified. If a
15 particular scope is required, be sure to specify it using the <code>scope</code> argument.</div></li>
16 <li><code>interval</code> : Number<div class="sub-desc">The frequency in milliseconds with which the task
17 should be executed.</div></li>
18 <li><code>args</code> : Array<div class="sub-desc">(optional) An array of arguments to be passed to the function
19 specified by <code>run</code>.</div></li>
20 <li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<tt>this</tt> reference) in which to execute the
21 <code>run</code> function. Defaults to the task config object.</div></li>
22 <li><code>duration</code> : Number<div class="sub-desc">(optional) The length of time in milliseconds to execute
23 the task before stopping automatically (defaults to indefinite).</div></li>
24 <li><code>repeat</code> : Number<div class="sub-desc">(optional) The number of times to execute the task before
25 stopping automatically (defaults to indefinite).</div></li>
26 </ul></div></li></ul><strong>Returns:</strong><ul><li><code>Object</code><div class="sub-desc">The task</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.TaskRunner.html#start" ext:member="#start" ext:cls="Ext.util.TaskRunner">TaskRunner</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.TaskRunner-stop"></a><b><a href="source/TaskMgr.html#method-Ext.util.TaskRunner-stop">stop</a></b>( <code>Object task</code> )
28 Object<div class="mdesc"><div class="short">Stops an existing running task.</div><div class="long">Stops an existing running task.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>task</code> : Object<div class="sub-desc">The task to stop</div></li></ul><strong>Returns:</strong><ul><li><code>Object</code><div class="sub-desc">The task</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.TaskRunner.html#stop" ext:member="#stop" ext:cls="Ext.util.TaskRunner">TaskRunner</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.TaskRunner-stopAll"></a><b><a href="source/TaskMgr.html#method-Ext.util.TaskRunner-stopAll">stopAll</a></b>()
30 void<div class="mdesc"><div class="short">Stops all tasks that are currently running.</div><div class="long">Stops all tasks that are currently running.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.TaskRunner.html#stopAll" ext:member="#stopAll" ext:cls="Ext.util.TaskRunner">TaskRunner</a></td></tr></tbody></table><a id="Ext.TaskMgr-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>