PDA

View Full Version : Selecting read-only cells in a GridPanel for copy/pasting?



ayqazi
24 Mar 2011, 8:07 AM
Hi,

I notice that when I have a column in a GridPanel set to read-only, I cannot select the text in it. Anyone have any ideas how I can let users do this, or allow users to copy/paste text from read-only columns in a GridPanel in some other way?

Thanks

Regards,
Asfand

kohyea
25 Mar 2011, 6:59 PM
var grid = new Ext.grid.GridPanel({
viewConfig: {
cellTpl: new Ext.Template(
'<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>',
'<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',
'</td>'
)
}
});

you need to change the cellTpl on gridView.

Kohyea

ayqazi
28 Mar 2011, 1:03 AM
Sorry for the lateness of my reply, weekend got in the way :P

I tried that..... and clicking/dragging still does not highlight anything... i.e. nothing has changed from before I added the the grid's config.

I also tried changing the unselectable to 'off', which made more sense to me, and I still cannot select any text.

Am I doing something wrong?

Regards,
Asfand