1. #31
    Ext User
    Join Date
    Jun 2009
    Posts
    23
    Vote Rating
    0
    Copernicus is on a distinguished road

      0  

    Exclamation


    I cant get this much needed functionality to work and I really need it for a project Im working on. Anyone getting this to work with Ext JS 3.0? I realize this thread is for 2.0 though, but I didnt want to start a new one since this may still work in Ext 3.0 for some...

    Ive tried everything in this thread. Ive also tried with/without Ext.grid.RowNumberer() but it makes no difference.

    Im kind of stuck on this at the moment, so if anyone has some hints...

  2. #32
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Antwerp, Belgium
    Posts
    557
    Vote Rating
    27
    joeri has a spectacular aura about joeri has a spectacular aura about joeri has a spectacular aura about

      0  

    Default


    I've got cell text selection working in an ExtJS 3 grid:

    - CSS style:
    .x-grid3-cell-selectable, .x-grid3-cell-selectable * {-moz-user-select: text!important; -khtml-user-select: text!important}
    - Code:
    Code:
    viewConfig: {
      templates = {
        cell: new Ext.Template(
          '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} x-grid3-cell-selectable {css}"' + 
          ' style="{style}" tabIndex="0" {cellAttr}>', 
          '<div class="x-grid3-cell-inner x-grid3-col-{id}" {attr}>{value}</div>', 
          '</td>')
      }
    }

  3. #33
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    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


    You could also have found this answer in the Grid FAQ.

  4. #34
    Ext User
    Join Date
    Jun 2009
    Posts
    23
    Vote Rating
    0
    Copernicus is on a distinguished road

      0  

    Default


    Hi guys and thank you for the very quick reply. I had tried everything in the Grid FAQ yesterday (which is excellent by the way!) and I saw this tip but it didnt work.

    It turns out that I had enableDragDrop set to true which makes it fail. When its set to false, it works perfectly.

    Is there a workaround for the cell text copy when using drag & drop?

    Thanks in advance! Having a lot of fun with your product.

  5. #35
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Antwerp, Belgium
    Posts
    557
    Vote Rating
    27
    joeri has a spectacular aura about joeri has a spectacular aura about joeri has a spectacular aura about

      0  

    Default


    This should really be a standard feature of the grid. I imagine a lot of people end up implementing this workaround.

  6. #36
    Ext User
    Join Date
    Jun 2009
    Posts
    23
    Vote Rating
    0
    Copernicus is on a distinguished road

      0  

    Default


    Yes I agree. Being able to copy/paste entire rows is what Im personally would love to have as built-in functionality. It must be extremely common that people need to get their data into another application like a email program or spreadsheet.

    The absolute best would be if it was possible to get it into the clipboard, but after doing some googling on this topic, it seems its awkward to do. Every copy/paste to browser clipboard solution out there seems to be based on having a hidden flash component and then get it into the clipboard from there.

    However, in version 10 of Flash, this was made even more difficult since Adobe (for security reasons, I guess) now requires that the user clicks the flash component for copy into clipboard to work. So there are some hacks out there (ZeroClipboard for example) where you can position a invisible flash movie over a button and get it into the clipboard. Not very elegant, but I guess its the only way for now.

  7. #37
    Ext JS Premium Member Artistan's Avatar
    Join Date
    Apr 2007
    Location
    MN
    Posts
    144
    Vote Rating
    0
    Artistan is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    You could also have found this answer in the Grid FAQ.
    Excellent!
    Saved me alot of time.
    Much appreciated.

    1 more vote for grid.disableTextSelection(false) or similar functionality.

  8. #38
    Ext JS Premium Member
    Join Date
    Nov 2008
    Posts
    63
    Vote Rating
    0
    JAnderson is on a distinguished road

      0  

    Default


    Quote Originally Posted by Artistan View Post
    1 more vote for grid.disableTextSelection(false) or similar functionality.
    I agree

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

      0  

    Default


    +1 for this
    or +1000
    This is very very annoying "feature" of grid. In this long thread, it was never explained why this behavior is default. It is strange for me, because all native tables, texts, controls etc in html are selectable by default, I think. So it looks like this selection-disablement in grids was made by purpose. But what purpose? I can't imagine any use case where is could be useful. So why?
    Please, turn this anti-feature off by default in Ext 3.1. If it is needed by anybody in some cases, probably there can be an option in component settings to turn it on.

  10. #40
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Antwerp, Belgium
    Posts
    557
    Vote Rating
    27
    joeri has a spectacular aura about joeri has a spectacular aura about joeri has a spectacular aura about

      0  

    Default


    @grzegorz.borkowski
    I suspect because the grid has its own row-level selection. Text selection and row selection never mash together perfectly. With the hacks you find in this page you can get reasonably close, but there are odd quirks in the behavior when the text is selectable.