首页 > Web开发 > 详细

修复Extjs5.1.4表格设置enableTextSelection: true之后,文本仍然不能选择的BUG

时间:2017-05-04 14:31:39      阅读:1185      评论:0      收藏:0      [点我收藏+]
如果您发现其他版本也有此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

原文:http://www.cnblogs.com/jiawenjun/p/6806565.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!