Search code examples
extjssencha-touchextjs7

How to copy text with your finger in ExtJS?


I'm using ExtJs 7 - Modern

Unfortunately, in all objects, text cannot be copied in the usual way by selecting it with a finger.

Can you please tell me if there is any solution for this feature?


Solution

  • By default most components are not user selectable.

    Set the body of a container as user selectable and you can select the text with your finger or a mouse.

    xtype: 'container',
    userCls: 'ordersummary',
    style: {
      'border': '1px solid black',
      'padding': '5px',
      'margin': '0 0 5px 0'
    },
    // this is what makes it selectable.
    userSelectable: {
      bodyElement: 'text'
    },

    see the userSelectable config for Ext.Container. it is basically setting the user-select