<link rel="stylesheet" type="text/css" href=" <%=basepath%>/ext-3.4/resources/css/ext-all.css "> <script type="text/javascript" src="<%=basepath%>/ Ext-3.4/adapter/ext/ext-base.js "></script> <script type="text/javascript" src="<%=basepath%>/ext-3.4/ Ext-all-debug.js "></script> <script type="text/javascript" src="<%=basepath%>/ Jsp/js/hellowindow.js "></script> <script type="Text/javascript"> //We know that the timer function provided by JavaScript has settimeout (call function after a specified time), setinterval (Specify frequency call function), etc. //EXT timing has Ext.util.DelayedTask similar to Settimeout,ext.util.taskrunner Java thread function, can generate independent tasks or threads varTask =NewExt.util.DelayedTask ( function(){Console.info (' Start execution function ... '); }); Task.delay ( the);//below demonstrates how Delayedtask receives parameters The //function receives the order of the parameter data set in the corresponding parameter function catchsome(command1,command2,command3){Console.info (' executive work: '+command1+', '+command2+', '+COMMAND3); }varTask2 =NewExt.util.DelayedTask ();//The parameters worn to the function must be defined in the array varcommands = [' Buy milk ',' buy a newspaper ',' pick up the kids ']; Task2.delay ( the,//How long after executionCatchsome,//function to execute This,//scope of function execution, default windowCommands//Parameters);//Ext.util.TaskRunner usage is as follows function sayhi(){Console.debug (' Hi '); }varTask3 = {Run:sayhi, interval: +};//Instantiate Taskrunner and call Start () to start the task varRunner =NewExt.util.TaskRunner (); Runner.start (TASK3);//can also be started by Taskmgr (Task Manager) class vari =0; function sayHello(){ if(I >=Ten) {Ext.TaskMgr.stop (TASK4); } console.debug (' stop say Hello '); i++; }varTask4 = {Run:sayhello, interval: -}; Ext.TaskMgr.start (TASK4);</script>
Timed Call function for ExtJS