1. #41
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    No, text and row selection can work together.

    Only parts that use the mousedown event can cause a problem, e.g.
    - enableDrag, enableDragDrop
    - enableColumnMove, enableColumnResize
    - clicksToEdit:'auto'
    - CellSelectionModel
    - CheckboxSelectionModel

  2. #42
    Sencha User
    Join Date
    Dec 2008
    Location
    Lodz, Poland
    Posts
    173
    Vote Rating
    3
    grzegorz.borkowski is on a distinguished road

      0  

    Default


    Exactly, I don't see any problem between text selection and row selection. On the other hand, drag and drop can be a problem, really - the same mouse gesture can be interpreted as text selection or row/cell dragging...

  3. #43
    Sencha User
    Join Date
    Dec 2008
    Location
    Lodz, Poland
    Posts
    173
    Vote Rating
    3
    grzegorz.borkowski is on a distinguished road

      0  

    Default


    Now, when I think about it, I come to the following conclusion:
    - enableDrag, enableDragDrop: Drag and drop in grid body and text selection seems mutually exclusive from logical point of view. So when D&D is enabled, the text may became unselectable. Most of grids don't use D&D, so this is not a big problem.
    - clicksToEdit:'auto' - I'm not sure if there is some inherent conflict here; is seems to me that they could work together; even if not, I can use clickToEdit set to 1 or 2, so it's not crucial either.
    - CellSelectionModel - again, I don't see why it can't work together with text selection; but I can also probably live with it it, as CellSelectionModel is used more with editor grids, when you can select text in editor (though you can't select multiple cells/rows this way)
    - CheckboxSelectionModel - checkbox selection model seems very similar to row selection model, so why it can't work with text selection?
    - enableColumnMove, enableColumnResize - here we have the real problem... one of the reasons for using Ext grids is ability to resize and shuffle columns; turning this options off removes much of grid value. At the same time, lack of text selection also lowers grids value... so the most imporant thing IMHO is to marry text selection in grid with column resizing and dragging... in theory, it could be solved this way: when enableColumnMove/Resize is turned on, text selection only works in grid body, not in grid header; but starting selection of the text from below header (i.e. on the grid body cell) and streching it onto header, one should be able to select header this way; on the other hand, if column moving and resizing is turned off, text selection could work on headers too (but what about sorting the column by clicking on it's header? probably similar rule would apply)

  4. #44
    Ext JS Premium Member
    Join Date
    May 2008
    Location
    Austria, Vienna
    Posts
    219
    Vote Rating
    1
    abraxxa is on a distinguished road

      0  

    Default


    Will this be added to the grid as a config option in a future version?

  5. #45
    Sencha Premium Member Wedgie's Avatar
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    76
    Vote Rating
    0
    Wedgie is on a distinguished road

      0  

    Default


    I'd also like this to be an official config option please.

    Hopefully some passing Premium Support customer will feel strongly enough to post this as a feature request.

  6. #46
    Sencha User
    Join Date
    Mar 2010
    Posts
    83
    Vote Rating
    -1
    daiei27 is an unknown quantity at this point

      0  

    Thumbs up


    Quote Originally Posted by mcduke View Post
    I fourth that motion.
    Using Ext to modernize my company's web applications. Not being able to select&copy grid/tree text is one of the only huge drawbacks I've encountered.
    I thousandth that motion! Agree 100%.

  7. #47
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Antwerp, Belgium
    Posts
    559
    Vote Rating
    29
    joeri has a spectacular aura about joeri has a spectacular aura about joeri has a spectacular aura about

      0  

    Default


    I've hacked this into my grids as a "standard" feature as well. Since most people that use grids have to add this as a hack, why not integrate it into the core grid?

  8. #48
    Ext User
    Join Date
    Dec 2008
    Posts
    16
    Vote Rating
    0
    newedge is on a distinguished road

      0  

    Default


    Is this override possible for the Ext.ux.grid.RowExpander. I need that text selectable as well.

  9. #49
    Sencha Premium Member Wedgie's Avatar
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    76
    Vote Rating
    0
    Wedgie is on a distinguished road

      0  

    Default


    Joeri, since you have Premium Support subscription would you consider making a post about this in your Feature Request forum? The request will actually get tracked by Ext there.

  10. #50
    Sencha User
    Join Date
    Mar 2009
    Posts
    71
    Vote Rating
    0
    SantaBarbarian is on a distinguished road

      0  

    Default Confused I guess

    Confused I guess


    I tried Condor's solution without any copy/paste success (no javascript errors, the grid displays as before). Can anyone tell me if I'm doing something stupid?

    Here is what I did:

    I added 2 include lines (indicated with **) as follows:
    HTML Code:
    <link rel="stylesheet" type="text/css" href="ext-2.2.1/resources/css/ext-all.css">
    <link rel="stylesheet" type="text/css" href="css/pastableGrid.css"> **
    <script type="text/javascript" src="ext-2.2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="ext-2.2.1/ext-all.js" ></script>
    <script type="text/javascript" src="javascript/pastableGrid.js"></script> **
    <script type="text/javascript" src="javascript/myGridPanel.js"></script>
    where pastableGrid.css contains:

    HTML Code:
    <style type="text/css">
        .x-selectable, .x-selectable * {
            -moz-user-select: text!important;
            -khtml-user-select: text!important;
        }
    </style>
    and pastableGrid.js contains:

    Code:
    if (!Ext.grid.GridView.prototype.templates) {
        Ext.grid.GridView.prototype.templates = {};
    }
    Ext.grid.GridView.prototype.templates.cell = 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>'
    );
    The grid in myGridPanel.js is defined as follows:

    Code:
        var pitcherStatsGrid = new Ext.grid.GridPanel({
        viewConfig: {
            templates: {
                cell: 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>'
                )
            }
        },
            store: store,
            ...
    I've tried selecting control-c to copy and double clicking to select. The contents of my grid never make it into the clipboard.