PDA

View Full Version : Ext.view.Table enableTextSelection config Not Working



Vizzlepuff
1 Jun 2015, 3:52 PM
When the enableTextSelection config for Ext.view.Table is added to an Ext.grid.Panel and set to true, the text in the grid is still not selectable. In previous ExtJS versions, the enableTextSelection config could be added to a grid as follows:


Ext.define('ManualViewer.view.main.List', {
extend: 'Ext.grid.Panel',
xtype: 'mainlist',
store: 'PolicyChunks',
scroll: 'vertical',
viewConfig: {
enableTextSelection: true,
float: true,
disableSelection: true,
stripeRows: false,
preserveScrollOnRefresh: true,
trackOver: false
},
columns: [
{
dataIndex: 'content',
flex: 1
}
]
});


Such Grid config no longer results in columns containing selectable text.

Gary Schlosberg
2 Jun 2015, 8:53 AM
Thanks for the report. Can you please post a test case which reproduces this issue?
https://fiddle.sencha.com/#home

Vizzlepuff
2 Jun 2015, 9:52 AM
Here is a Sencha Fiddle that works (allows text selection in grid cells) in Ext JS 5 but not in Ext JS 6: https://fiddle.sencha.com/#fiddle/nt9

Gary Schlosberg
5 Jun 2015, 3:38 PM
Thanks for the test case. It looks like this issue was recently resolved as part of EXTJS-16146. I see it using Tuesday's nightly release, but not using Wednesday's or last night's.

matko.novak
19 Feb 2016, 4:49 AM
The issue got actual again. Text selection not working at EXTJS-6.0.2.330

advertise
20 Apr 2016, 11:24 AM
Yes I am able to see it on 6.0.2.437 also. Is this bug being worked upon by Sencha Team?

Gary Schlosberg
20 Apr 2016, 2:28 PM
Thanks for the update. Looks like it's been fixed again. I do see the regression in 6.0.2 and in 6.0.3 nightlies as recently as 4/6, but more recent nightlies allow selection as expected.

advertise
20 Apr 2016, 4:37 PM
Which "latest" exact version (major and minor) has this fix available?

Gary Schlosberg
27 Apr 2016, 5:32 AM
It has been fixed in 6.0.3 nightlies built after 4/6.

hakimio
27 Apr 2016, 6:54 AM
Simple override for 6.0.2:

Ext.define('Ext.overrides.NavigationModel', {
override: 'Ext.grid.NavigationModel',

onCellMouseDown: function(view, cell, cellIndex, record, row, recordIndex, mousedownEvent) {
var targetComponent = Ext.Component.fromElement(mousedownEvent.target, cell),
ac;

if (view.actionableMode && (mousedownEvent.getTarget(null, null, true).isTabbable() || ((ac = Ext.ComponentManager.getActiveComponent()) && ac.owns(mousedownEvent)))) {
return;
}

if (mousedownEvent.pointerType !== 'touch') {
//FIX: following line was preventing text selection
//mousedownEvent.preventDefault();
this.setPosition(mousedownEvent.position, null, mousedownEvent);
}

if (targetComponent && targetComponent.isFocusable && targetComponent.isFocusable()) {
view.setActionableMode(true, mousedownEvent.position);

targetComponent.focus();
}
}
});