Я не думаю, что есть «чистый» способ сделать это.Это задержит опцию однократного нажатия на 300 мс, что может быть неприемлемо.Вы можете упростить взаимодействие с пользовательским интерфейсом, если можете.Может быть, нажмите и удерживайте?
Я нашел этот код на форумах Sencha Touch .
setupEventHandlers: function(){
this.mon(this.el, {
tap: function(e){
if(this.delayedTask == null){
//setup a delayed task that is called IF double click is not later detected
this.delayedTask = new Ext.util.DelayedTask(
function(){
this.doSomethingInteresting();
this.delayedTask = null;
}, this);
//invoke (with reasonable time to cancel)
this.delayedTask.delay(300);
}
},
doubletap: function(e){
//cancel and clear the queued single click tasks if it's there
if(this.delayedTask != null){
this.delayedTask.cancel();
this.delayedTask = null;
}
//handle the double click
this.doSomethingReallyInteresting();
},
scope: this
});
},