Sencha Touch setTimeout(函数,timeoutNumber)不起作用

时间:2011-12-31 01:05:25

标签: sencha-touch

Sencha Touch中的setTimeout()函数不起作用。它会在调用setTimeout时立即执行代码。有没有人有过这个bug的经验/解决方法?

2 个答案:

答案 0 :(得分:2)

为什么不使用Ext.Functions.defer; (简称:Ext.defer)

// this syntax is sometimes useful for deferring execution of an anonymous function:
Ext.defer(function(){}, millisecs, scope);

// defer the answer 100ms with the current scope
Ext.defer(function() {
    alert('Anonymous');
}, 100, this);

答案 1 :(得分:0)

Defer是Sencha

中SetTimeout函数的变体
Ext.Function.defer(function () {
    alert('Anonymous');
}, 5000);