1. #71
    Sencha User
    Join Date
    Oct 2010
    Posts
    2
    Vote Rating
    0
    ynikulin is on a distinguished road

      0  

    Default


    Try this solution. Works in all browsers

    PHP Code:
    .x-grid-row ,.x-grid-cell, .x-unselectable, .x-unselectable * {
     -
    webkit-user-selecttext !important;
     -
    o-user-selecttext !important;
     -
    khtml-user-selectall !important;
     -
    ms-user-selecttext !important;
     
    user-selecttext !important;
     -
    moz-user-selecttext !important;

    PHP Code:
     if(typeof Ext != 'undefined'){
      
    Ext.core.Element.prototype.unselectable = function(){return this;};
      
    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 class="' Ext.baseCSSPrefix 'grid-cell-inner ' Ext.baseCSSPrefix 'unselectable" style="{{id}-style}; text-align: {align};">{{id}}</div></td>',
        
    '</tpl>',
       
    '</tr>'
      
    ];
     } 
    www.bizzclick.com - Pay Per Click solutions

  2. #72
    Sencha User eliotik's Avatar
    Join Date
    May 2010
    Posts
    27
    Vote Rating
    0
    eliotik is on a distinguished road

      0  

    Default


    for ExtJS 4
    Code:
    div#GRIDID div.x-unselectable {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    div#GRIDID div.x-unselectable tr.x-grid-row div.x-grid-rowwrap-div td.x-grid-cell
    {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    div#GRIDID div.x-unselectable tr.x-grid-row div.x-grid-rowwrap-div td.x-grid-cell div.x-unselectable
    {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    div#GRIDID div.x-unselectable tr.x-grid-row
    {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    where GRIDID is your grid id in which you will need to select and copy data

  3. #73
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
    svignesh89 is on a distinguished road

      0  

    Question GridView select

    GridView select


    Hi

    I created gridview(ie 5 columns, 12 rows).. I want to make 1 row clickable, not all (for example: ID is a Single columnfield) ID in 12 rows should be able to click like we using link in html... if we click on particular ID it should display some other datas in other table(ie another grid view)... pls help me out sir... i am new to extjs..
    Clickable and how to give link is needed... pls help me... Thanks in advance..

  4. #74
    Sencha User
    Join Date
    Mar 2011
    Posts
    19
    Vote Rating
    0
    dhruv88esh is on a distinguished road

      0  

    Default This solution is working for all browsers

    This solution is working for all browsers


    grid.disableTextSelection(false);


    Cheers

  5. #75
    Sencha User
    Join Date
    Mar 2008
    Posts
    53
    Vote Rating
    2
    manilodisan is on a distinguished road

      0  

    Default


    there is no such method for grids or anywhere else in extjs: disableTextSelection

  6. #76
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    165
    Vote Rating
    0
    simon is on a distinguished road

      0  

    Default


    I have ext.3.4.0.

    This text select doesn't work in Chrome:
    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>'
    );
    It works in IE. Any idea?
    br, Simon

  7. #77
    Sencha User
    Join Date
    Mar 2012
    Posts
    211
    Vote Rating
    0
    hieu79vn is an unknown quantity at this point

      0  

    Default


    Hello
    your code is very good. Can we apply it only for a specific grid?

    Thank you

  8. #78
    Sencha User
    Join Date
    Mar 2012
    Posts
    211
    Vote Rating
    0
    hieu79vn is an unknown quantity at this point

      0  

    Default


    Hi,

    Is there other codes which doesnt use the grid id but can apply for a specific grid?

    Thank you

    Quote Originally Posted by eliotik View Post
    for ExtJS 4
    Code:
    div#GRIDID div.x-unselectable {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    div#GRIDID div.x-unselectable tr.x-grid-row div.x-grid-rowwrap-div td.x-grid-cell
    {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    div#GRIDID div.x-unselectable tr.x-grid-row div.x-grid-rowwrap-div td.x-grid-cell div.x-unselectable
    {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    div#GRIDID div.x-unselectable tr.x-grid-row
    {
     -webkit-user-select: text !important;
     -o-user-select: text !important;
     -khtml-user-select: all !important;
     -ms-user-select: text !important;
     user-select: text !important;
     -moz-user-select: text !important;
    }
    where GRIDID is your grid id in which you will need to select and copy data

  9. #79
    Sencha User
    Join Date
    Mar 2012
    Posts
    211
    Vote Rating
    0
    hieu79vn is an unknown quantity at this point

      0  

    Default


    Hello

    this code works in IE
    if(typeof (Ext) != 'undefined'){
    Ext.core.Element.prototype.unselectable = function(){return this;};
    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 class="' + Ext.baseCSSPrefix + 'grid-cell-inner ' + Ext.baseCSSPrefix + 'unselectable" style="{{id}-style}; text-align: {align};">{{id}}</div></td>',
    '</tpl>',
    '</tr>'
    ];
    }

    but after I change value of record which cause the grid redraw, it doesn't work any more. How can I solve it?
    Thank you

  10. #80
    Sencha User
    Join Date
    Oct 2011
    Posts
    26
    Vote Rating
    1
    hundare is on a distinguished road

      0  

    Default


    This code does not work for ExtJS 4. I copied this code in my CSS. Do i need to copy it to ext.css?