标签:efault pre 表格 ext lin prevent default 选择 return
如果您发现其他版本也有此BUG,可参照此方式进行修复,源代码中多了一句拦截mousedown事件的代码mousedownEvent.preventDefault()造成的。
Ext.define(‘Ext.override.grid.NavigationModel‘,{
override:‘Ext.grid.NavigationModel‘,
onCellMouseDown: function(view, cell, cellIndex, record, row, recordIndex, mousedownEvent) {
var parentEvent = mousedownEvent.parentEvent,
targetComponent = Ext.Component.fromElement(mousedownEvent.target, cell),
column = mousedownEvent.position && mousedownEvent.position.column,
cellEditing = view.grid.findPlugin(‘cellediting‘);
if (targetComponent && targetComponent.isFocusable && targetComponent.isFocusable()) {
if (!cellEditing || !cellEditing.editing) {
targetComponent.focus();
}
if (column && column.stopSelection !== false) {
return;
}
}
if (!parentEvent || parentEvent.type !== ‘touchstart‘) {
this.setPosition(mousedownEvent.position, null, mousedownEvent);
}
}
});
修复Extjs5.1.4表格设置enableTextSelection: true之后,文本仍然不能选择的BUG
标签:efault pre 表格 ext lin prevent default 选择 return
原文地址:http://www.cnblogs.com/jiawenjun/p/6806565.html