日期:2014-05-16 浏览次数:20562 次
var sayHi = function(name){ alert('Hi, ' + name); } // executes immediately: sayHi('Fred'); // executes after 2 seconds: Ext.defer(sayHi, 2000, this, ['Fred']); // this syntax is sometimes useful for deferring // execution of an anonymous function: Ext.defer(function(){ alert('Anonymous'); }, 100); //下面是Ext中定时运行任务 //每隔5分钟定时任务 var updateMsg = function(){ alert('每隔五分钟我就要出现!'); } var task = { run: updateMsg, interval: 300000 //300 second } var runner = new Ext.util.TaskRunner(); runner.start(task);
------解决方案--------------------
Ext.util.DelayedTask 可以用这两个
Ext.util.DelayedTask类从名字上就可以看出它是推迟任务管理
参考这个地方