Как задать задержку времени в сообщении msg ok о событии кнопки в сенсорном сенсоре - PullRequest
1 голос
/ 09 ноября 2011
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, текст) {

if (btn == 'ok'){

// DO WORK

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

}else{
return false;
}
});

1 Ответ

4 голосов
/ 09 ноября 2011

если вы хотите добавить задержку, вы можете использовать встроенный метод setTimeout:

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