-
6 Nov 2008 2:41 AM #1
Possible to copy text from Grid and List?
Possible to copy text from Grid and List?
I've made an gxt application using somne Grids and Lists. I want to give the user the possibility to select and copy any text displayed in a Grid/List. Is this possible to achieve? The default behavour of Grid/List does not permit this possibility.
I'm using gxt 1.1
-
23 Mar 2009 8:15 AM #2
Is there a way to select text in a grid row? More specifically, highlighting text within a row, right-clicking and copying.
-
6 May 2009 5:29 AM #3
did you ever get an answer to this? I am trying to find a solution to the same thing.
When you click on a cell in an Editable Grid, I want the existing value to be highlighted so you can overwrite the existing value without having to highlight it with the mouse first.
-
6 May 2009 6:44 AM #4
well if it is a textfield you can do setselectonfocus(true) to select the text on focus.
-
6 May 2009 9:53 AM #5
It is a grid column not a textfield. So your suggestion will not work and I dont see a similiar method on a ColumnConfig object.
-
6 May 2009 9:55 AM #6
There is a css rule in place that disables textselection. You can just override this css rule.
-
6 May 2009 10:19 AM #7
Can you post an example? I am new to GWT EXT and to CSS. I am not sure which object to be setting the style on (i.e. the grid or the cell) and I dont know exactly what i should be changing.
thanks.
-
7 May 2009 11:20 AM #8
I figured out the following which will highlight the contents of a Grid cell when the cell is selected.
Code:SummaryColumnConfig hours = new SummaryColumnConfig("hours", "Hours", 20); NumberField nf = new NumberField(); nf.setAutoValidate(true); CellEditor ce = new CellEditor(nf); ce.setCancelOnEsc(true); ce.getField().addListener(Events.Focus, new Listener<FieldEvent>() { public void handleEvent(FieldEvent be) { TextField t = (TextField) be.boxComponent; t.selectAll(); } }); hours.setEditor(ce);
-
13 May 2009 3:48 PM #9
Hi, any one knows how to change the css to accomplish this?
I tried to change the unselectable="on" and set it to "off" in the GridView.js
But seems not working.Code:initTemplates: function(){ ...... if(!ts.cell){ ts.cell = 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="off" {attr}>{value}</div>', "</td>" ); } }
My cell is non-editable, so I can't attach an editor to it. I'm using Ext 2.0 and this is the only related thread I can find on the forum regarding the mouse highlight and select question.
I'm using a "rowExpander" to show some additional row information but the same thing, I can't highlight any content and right click and copy. If I can achieve this on my rowExpander, then I'm ok too.
Please help.
good good study,
day day up ; )
-
27 May 2009 9:47 AM #10
What is the CSS style that disabled text selection? I see the -moz-user-select style is set to none, but doesn't this only apply to Mozilla? What about IE?
Rackspace Software Developer


Reply With Quote