-
14 Jun 2010 5:11 PM #61
-
29 Aug 2010 8:40 PM #62
-
29 Aug 2010 11:17 PM #63
problem 1:
in IE, when multi-select with SHIFT key, all the text will be selected
problem 2:
override of prototype.templates
see this thread:
http://www.sencha.com/forum/showthre...id-quot-in-FAQ
-
10 Sep 2010 8:42 PM #64
This works!
This works!
Thanks, Condor and DK!
(Was this enabled by default in 2.1, I wonder....)
-
25 Nov 2010 1:19 AM #65
I found a problem if there a second row in the grid defined in the getRowClass method.
I've noticed that second row disappear because something beyond my understandings happens in the next line:
Then I've noticed that another solution that allows you to select text in a grid, is just to return the x-selectable class in the getRowClass, but I've only tested on Firefox.Code:Ext.grid.GridView.prototype.templates = {};
Condor would you be kind and tell me if it's ok to use the following code in order to aviod the problem that I've mention above:Code:viewConfig: { getRowClass: function(record, rowIndex, rp, ds){ return "x-selectable"; } }
The code above makes the text selectable in all grids and you also have the second row in the grid display.Code:Ext.override(Ext.grid.GridView, { cellTpl: new Ext.Template( '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} x-selectable {css}" style="{style}" tabIndex="0" {cellAttr}>', '<div class="x-grid3-cell-inner x-grid3-col-{id}" {attr}>{value}</div>', '</td>' ) });
Please note that in order to be able to select the text in the second row also the getRowClass must return the x-selectable class.
-
25 Nov 2010 2:31 AM #66Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Your override should ofcourse only contain the second cellTpl, and yes, it will also work (but only on Ext 3.3+, because older versions didn't have a cellTpl GridView property).
-
25 Nov 2010 3:25 AM #67
ups, I updated the code.
thz for the answer
-
2 Jun 2011 12:44 PM #68
Thanks for the contribution Condor. I'm trying to do the same in Ext JS 4 but I'm not exactly sure which class I should override. I see the code in the distro, but I can't seem to override it without a JavaScript error.
I also tried this CSS override which works fine for FF but not for webkit browsers:Code:Ext.override( Ext.view.TableChunker, { metaRowTpl: [ '<tr class="' + Ext.baseCSSPrefix + 'grid-row {addlSelector} {[this.embedRowCls()]}" {[this.embedRowAttr()]}>', '<tpl for="columns">', '<td class="{cls} ' + Ext.baseCSSPrefix + 'grid-cell ' + Ext.baseCSSPrefix + 'grid-cell-{columnId} {{id}-modified} {{id}-tdCls} {[this.firstOrLastCls(xindex, xcount)]}" {{id}-tdAttr}><div unselectable="off" class="' + Ext.baseCSSPrefix + 'grid-cell-inner ' + Ext.baseCSSPrefix + 'unselectable" style="{{id}-style}; text-align: {align};">{{id}}</div></td>', '</tpl>', '</tr>' ] });
Thoughts to get this working in Ext JS 4?Code:<style type="text/css"> .x-unselectable, .x-unselectable * { -moz-user-select: inherit !important; -webkit-user-select: text !important; -khtml-user-select: text !important; } </style>
-
8 Jun 2011 9:29 AM #69
I too would love the ability to select text in a grid in this way. I want to be able to swipe and copy all table contents.
-
13 Jun 2011 4:03 AM #70
Hi everyone
I just want to be able to select text from a TreeGrid panel cells. I tried all the mentioned way but no result. please help. thanks
it serious


Reply With Quote