Results 1 to 6 of 6

Thread: Selectable innerText of Grid Cell

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    2

    Default Selectable innerText of Grid Cell

    Hi community,

    i read many about the workarrounds to make the text in the cells selectable for Copy n Paste.

    Ive tryed overriding the css styles (Browser: Chrome) and it didnt worked.

    My question is: is there a way to make the text selectable for IE,FF and Chrome? And if yes can some one share this knowledge with me pls? :-)


    Best

    ict34

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Try using:

    Code:
    Ext.create('Ext.grid.Panel', {
        ...
        viewConfig: {
            enableTextSelection: true
        }
    });
    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    2

    Default

    Hi, sorry for the delay....

    ive tryed this:



    Code:
          var grid = Ext.create('Ext.grid.Panel', {
                store: store,
                renderTo: 'grid1',
                bbar: PagingBar1,
                columns: [
                    {text: "<?php echo $colinvoicenr ?>", width: 120, dataIndex: 'rInvoiceNr', sortable: true, renderer:refundRendererPO },
                    {text: "<?php echo $colcustomer ?>", width: 150, dataIndex: 'rCustomerName', sortable: true, renderer: refundRendererPO},
                    {text: "<?php echo $colamount ?>", width: 90, dataIndex: 'rRefundAmount', sortable: true, renderer: renderMoneyPO},
                    {text: "<?php echo $colstatus ?>", flex: 1, dataIndex: 'rStatus', sortable: true, renderer: refundRendererPO},
                    {text: "<?php echo $coldate ?>", width: 100, dataIndex: 'rDate', sortable: true, renderer: refundRendererPO},
                
                ],
                viewConfig: {
                    forceFit: true,
                    enableTextSelection: true
                },
                height:210,
                split: true,
                region: 'north'
            });

    With extJS Version 4.0.7 is that right?

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    This will only work in 4.1. That feature is not available in 4.07

    Scott.

  5. #5
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    2

    Default Awesome!

    I can confirm that the viewConfig works in 4.1 Glad this was finally put in.

  6. #6
    Sencha User
    Join Date
    Jul 2011
    Posts
    72
    Answers
    2

    Default

    How to enable/disable selection by a button?

    My code:
    Code:
    tbar: Ext.create('Ext.toolbar.Toolbar', {
                items: [
                	{text: 'EnableTextSelection',
                     scope: this,
    
    handler: function(){ this.view.el.selectable(); },
    } ] });
    It only works in FF, did not work in chrome and IE8.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •