PDA

View Full Version : Selectable innerText of Grid Cell



icet34
13 Apr 2012, 6:39 AM
Hi community,

i read many about the workarrounds to make the text in the cells selectable for Copy n Paste.

Ive tryed overriding the css styles (Browser: Chrome) and it didnt worked.

My question is: is there a way to make the text selectable for IE,FF and Chrome? And if yes can some one share this knowledge with me pls? :-)


Best

ict34

scottmartin
13 Apr 2012, 9:34 AM
Try using:



Ext.create('Ext.grid.Panel', {
...
viewConfig: {
enableTextSelection: true
}
});


Regards,
Scott.

icet34
16 Apr 2012, 12:24 AM
Hi, sorry for the delay....

ive tryed this:





var grid = Ext.create('Ext.grid.Panel', {
store: store,
renderTo: 'grid1',
bbar: PagingBar1,
columns: [
{text: "<?php echo $colinvoicenr ?>", width: 120, dataIndex: 'rInvoiceNr', sortable: true, renderer:refundRendererPO },
{text: "<?php echo $colcustomer ?>", width: 150, dataIndex: 'rCustomerName', sortable: true, renderer: refundRendererPO},
{text: "<?php echo $colamount ?>", width: 90, dataIndex: 'rRefundAmount', sortable: true, renderer: renderMoneyPO},
{text: "<?php echo $colstatus ?>", flex: 1, dataIndex: 'rStatus', sortable: true, renderer: refundRendererPO},
{text: "<?php echo $coldate ?>", width: 100, dataIndex: 'rDate', sortable: true, renderer: refundRendererPO},

],
viewConfig: {
forceFit: true,
enableTextSelection: true
},
height:210,
split: true,
region: 'north'
});




With extJS Version 4.0.7 is that right?

scottmartin
16 Apr 2012, 5:45 AM
This will only work in 4.1. That feature is not available in 4.07

Scott.

c4stor
3 May 2012, 6:21 AM
I can confirm that the viewConfig works in 4.1 Glad this was finally put in.

ragecf
23 Jan 2013, 11:15 PM
How to enable/disable selection by a button?

My code:



tbar: Ext.create('Ext.toolbar.Toolbar', {
items: [
{text: 'EnableTextSelection',
scope: this,

handler: function(){
this.view.el.selectable();
},
}

]
});



It only works in FF, did not work in chrome and IE8.