1. #1
    Ext User
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    38
    Vote Rating
    0
    staffan is on a distinguished road

      0  

    Default 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

  2. #2
    Ext User dpope22's Avatar
    Join Date
    Apr 2008
    Location
    San Antonio, TX
    Posts
    35
    Vote Rating
    0
    dpope22 is on a distinguished road

      0  

    Default


    Is there a way to select text in a grid row? More specifically, highlighting text within a row, right-clicking and copying.

  3. #3
    Sencha User
    Join Date
    Apr 2009
    Posts
    25
    Vote Rating
    0
    Matt Kleweno is on a distinguished road

      0  

    Default


    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.

  4. #4
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239
    Vote Rating
    0
    kolli is on a distinguished road

      0  

    Default


    well if it is a textfield you can do setselectonfocus(true) to select the text on focus.

  5. #5
    Sencha User
    Join Date
    Apr 2009
    Posts
    25
    Vote Rating
    0
    Matt Kleweno is on a distinguished road

      0  

    Default


    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. #6
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    There is a css rule in place that disables textselection. You can just override this css rule.

  7. #7
    Sencha User
    Join Date
    Apr 2009
    Posts
    25
    Vote Rating
    0
    Matt Kleweno is on a distinguished road

      0  

    Default


    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.

  8. #8
    Sencha User
    Join Date
    Apr 2009
    Posts
    25
    Vote Rating
    0
    Matt Kleweno is on a distinguished road

      0  

    Default


    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);

  9. #9
    Ext User angelflaree's Avatar
    Join Date
    Jan 2008
    Posts
    64
    Vote Rating
    0
    angelflaree is on a distinguished road

      0  

    Default


    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
    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>"
            );
        }
    }
    But seems not working.

    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 ; )

  10. #10
    Ext User dpope22's Avatar
    Join Date
    Apr 2008
    Location
    San Antonio, TX
    Posts
    35
    Vote Rating
    0
    dpope22 is on a distinguished road

      0  

    Default


    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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."