Я сделал workaround
для вашей проблемы.
Я сравниваю точку tap
, если tap
совпадает с longpress
, я отклоняю ее.
var userStore = Ext.create('Ext.data.Store', {
data: [{
name: 'Lisa',
email: 'lisa@simpsons.com',
phone: '555-111-1224'
}, {
name: 'Bart',
email: 'bart@simpsons.com',
phone: '555-222-1234'
}, {
name: 'Homer',
email: 'homer@simpsons.com',
phone: '555-222-1244'
}, {
name: 'Marge',
email: 'marge@simpsons.com',
phone: '555-222-1254'
}]
});
var last_point = null;
Ext.create('Ext.grid.Grid', {
renderTo: Ext.getBody(),
store: userStore,
width: 400,
height: 200,
title: 'Application Users',
listeners: {
childtap: function (a, b, c, d) {
if (Ext.encode(b.event.touch.point) != last_point) {
console.log("child tap");
}
last_point = null;
},
childlongpress: function (a, b, c, d) {
last_point = Ext.encode(b.event.touch.point);
console.log("childlongpress Event")
}
},
columns: [{
text: 'Name',
width: 100,
sortable: false,
hideable: false,
dataIndex: 'name'
}, {
text: 'Email Address',
width: 150,
dataIndex: 'email',
hidden: true
}, {
text: 'Phone Number',
flex: 1,
dataIndex: 'phone'
}]
});
Пример на скрипке: https://fiddle.sencha.com/#fiddle/3021&view/editor