在Sencha中暂停一段时间



我遇到一个问题,我正在创建的网格在幻灯片动画期间而不是之后出现。因此,我决定使用计时器等待1秒,然后再创建网格视图。我该怎么做?setTimeout没有达到我预期的效果…

var task = new Ext.util.DelayedTask(function(){
    alert(Ext.getDom('myInputField').value.length);
});
// Wait 500ms before calling our function. If the user presses another key
// during that 500ms, it will be cancelled and we'll wait another 500ms.
Ext.get('myInputField').on('keypress', function(){
    task.delay(500);
});

请参阅Sencha Touch API参考

最新更新