Extjs默认对于单击和双击事件的响应方式是:一次双击会触发两次单击事件,和一次双击事件,如何能避免这个问题?
参考Extjs对buffer选项的处理方式:
<html class="x-border-box x-strict x-viewport"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
<title>V3</title>
<link rel="stylesheet" type="text/css" id="skin-ext" href="./extjs/resources/css/ext-all.css">
<link rel="stylesheet" type="text/css" id="skin-v3" href="./resources/default/css/share.css">
<script type="text/javascript" src="./extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="./extjs/locale/ext-lang-zh_CN.js" charset="utf-8"></script>
<script type="text/javascript">
Ext.onReady(function(){
var task = new Ext.util.DelayedTask();
var dealClick = function(type){
console.log(type);
};
new Ext.panel.Panel({
width: 400,
height: 200,
title : 'ddddddddd',
dockedItems: [{
xtype: 'toolbar'
}],
renderTo: document.body,
listeners: {
scope:this,
click: {
element: 'el',
fn: function(){
task.delay(500, dealClick, this, ['click']);
}
},
dblclick: {
element: 'el',
fn: function(){
task.delay(500, dealClick, this, ['double']);
}
}
}
});
});
</script>
</html>