Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.TaskManager.html
1 <!DOCTYPE html><html><head><title>Ext.TaskManager | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
2 <style type="text/css">.head-band { display: none; }
3 .header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
4 .doc-tab .members .member a.more { background-color: #efefef; }
5 </style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
6 </head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
7 <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
8
9     req = {
10         liveURL: '.',
11         standAloneMode: true,
12         origDocClass: 'Ext.TaskManager',
13         docClass: 'Ext.TaskManager',
14         docReq: 'Ext.TaskManager',
15         version: '4.0',
16         baseURL: '.',
17         baseDocURL: '.',
18         baseProdURL: '.'
19     };
20
21     clsInfo = {};
22
23
24
25 </script>
26
27 <script type="text/javascript" src="../search.js"></script>
28 <!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
29 <script type="text/javascript" src="../class_tree.js"></script>
30 <script type="text/javascript" src="../class_doc.js"></script>
31 <script type="text/javascript">
32     req.source = 'TaskManager.html#Ext-TaskManager';
33     clsInfo = {"methods":["TaskManager","start","stop","stopAll"],"cfgs":[],"properties":[],"events":[],"subclasses":[]};
34     Ext.onReady(function() {
35         Ext.create('Docs.classPanel');
36     });
37 </script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/TaskManager.html#Ext-TaskManager" target="_blank">Ext.TaskManager</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><pre class="subclasses"><h4>Hierarchy</h4><div class="subclass f"><a href="Ext.util.TaskRunner.html" rel="Ext.util.TaskRunner" class="cls docClass">Ext.util.TaskRunner</a><div class="subclass"><strong>Ext.TaskManager</strong></div></div></pre><p>A static <a href="Ext.util.TaskRunner.html" rel="Ext.util.TaskRunner" class="docClass">Ext.util.TaskRunner</a> instance that can be used to start and stop arbitrary tasks.  See
38 <a href="Ext.util.TaskRunner.html" rel="Ext.util.TaskRunner" class="docClass">Ext.util.TaskRunner</a> for supported methods and task config properties.</p>
39
40 <pre class="prettyprint"><code>// Start a simple clock task that updates a div once per second
41 var task = {
42     run: function(){
43         Ext.fly('clock').update(new Date().format('g:i:s A'));
44     },
45     interval: 1000 //1 second
46 }
47 Ext.TaskManager.start(task);
48 </code></pre>
49
50
51 <p>See the <a href="Ext.TaskManager.html#start" rel="Ext.TaskManager#start" class="docClass">start</a> method for details about how to configure a task object.</p>
52
53 <div class="members"><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-TaskManager" class="member f inherited"><a href="Ext.TaskManager.html#method-TaskManager" rel="method-TaskManager" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-constructor" class="viewSource">view source</a></div><a name="TaskManager"></a><a name="method-TaskManager"></a><a href="Ext.TaskManager.html#" rel="method-TaskManager" class="cls expand">TaskManager</a>(
54 <span class="pre">[Number interval]</span>)
55  : void</div><div class="description"><div class="short"><p>&nbsp;</p></div><div class="long">
56 <h3 class="pa">Parameters</h3><ul><li><span class="pre">interval</span> : Number<div class="sub-desc"><p>(optional) The minimum precision in milliseconds supported by this TaskRunner instance
57 (defaults to 10)</p>
58 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
59 </li></ul></div></div></div><div id="method-start" class="member inherited"><a href="Ext.TaskManager.html#method-start" rel="method-start" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-start" class="viewSource">view source</a></div><a name="start"></a><a name="method-start"></a><a href="Ext.TaskManager.html#" rel="method-start" class="cls expand">start</a>(
60 <span class="pre">[Object task]</span>)
61  : Object</div><div class="description"><div class="short"><p>Starts a new task.</p>
62 </div><div class="long"><p>Starts a new task.</p>
63 <h3 class="pa">Parameters</h3><ul><li><span class="pre">task</span> : Object<div class="sub-desc"><p>A config object that supports the following properties:<ul>
64 <li><code>run</code> : Function<div class="sub-desc"><p>The function to execute each time the task is invoked. The
65 function will be called at each interval and passed the <code>args</code> argument if specified, and the
66 current invocation count if not.</p>
67 <p>If a particular scope (<code>this</code> reference) is required, be sure to specify it using the <code>scope</code> argument.</p>
68 <p>Return <code>false</code> from this function to terminate the task.</p></div></li>
69 <li><code>interval</code> : Number<div class="sub-desc">The frequency in milliseconds with which the task
70 should be invoked.</div></li>
71 <li><code>args</code> : Array<div class="sub-desc">(optional) An array of arguments to be passed to the function
72 specified by <code>run</code>. If not specified, the current invocation count is passed.</div></li>
73 <li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<tt>this</tt> reference) in which to execute the
74 <code>run</code> function. Defaults to the task config object.</div></li>
75 <li><code>duration</code> : Number<div class="sub-desc">(optional) The length of time in milliseconds to invoke
76 the task before stopping automatically (defaults to indefinite).</div></li>
77 <li><code>repeat</code> : Number<div class="sub-desc">(optional) The number of times to invoke the task before
78 stopping automatically (defaults to indefinite).</div></li>
79 </ul></p>
80
81
82 <p>Before each invocation, <a href="Ext.html" rel="Ext" class="docClass">Ext</a> injects the property <code>taskRunCount</code> into the task object so
83 that calculations based on the repeat count can be performed.</p>
84
85 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>The task</p>
86 </li></ul></div></div></div><div id="method-stop" class="member inherited"><a href="Ext.TaskManager.html#method-stop" rel="method-stop" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-stop" class="viewSource">view source</a></div><a name="stop"></a><a name="method-stop"></a><a href="Ext.TaskManager.html#" rel="method-stop" class="cls expand">stop</a>(
87 <span class="pre">Object task</span>)
88  : Object</div><div class="description"><div class="short"><p>Stops an existing running task.</p>
89 </div><div class="long"><p>Stops an existing running task.</p>
90 <h3 class="pa">Parameters</h3><ul><li><span class="pre">task</span> : Object<div class="sub-desc"><p>The task to stop</p>
91 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>The task</p>
92 </li></ul></div></div></div><div id="method-stopAll" class="member inherited"><a href="Ext.TaskManager.html#method-stopAll" rel="method-stopAll" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-stopAll" class="viewSource">view source</a></div><a name="stopAll"></a><a name="method-stopAll"></a><a href="Ext.TaskManager.html#" rel="method-stopAll" class="cls expand">stopAll</a> : void</div><div class="description"><div class="short"><p>Stops all tasks that are currently running.</p>
93 </div><div class="long"><p>Stops all tasks that are currently running.</p>
94 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
95 </li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>