2011-11-09 15 views
1
I am new to sencha touch mobile and my issue is when i am clicking the alert MSG OK button my list view is also getting the click event in the portion of OK button . So i need to put some time delay before hiding the alert and clicking OK, can any one help how to give some time delay in alert OK button event or any other solution for the fix. Please find the below code. Thanks in advance. 

Ext.Msg.alert( '', '數據保存成功',函數(BTN,文字){如何給處於警戒MSG OK按鈕事件在煎茶觸摸

if (btn == 'ok'){ 

// DO WORK 

//Ext.defer(function(){ console.log('ok clicked');},400); 

}else{ 
return false; 
} 
}); 

回答

4

如果時間延遲你想添加一個延遲,你可以使用內置的setTimeout方法:

setTimeout(function() { 
    // do your work here 
}, 400);