1. #1
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    33
    Vote Rating
    0
    EmCy90 is on a distinguished road

      0  

    Default Answered: Select all text in text edtior

    Answered: Select all text in text edtior


    I have a basic grid that uses the cellediting plugin and the editors specified for the different columns are of type textfield. What i want to do is when a editor is opened the text in it to be selected. Any ideas ?

  2. In your textfield config, you can also specify:

    Code:
    {
      xtype: 'textfield',
      selectOnFocus: true
    }

  3. #2
    Sencha User
    Join Date
    Apr 2010
    Posts
    29
    Answers
    4
    Vote Rating
    0
    josephkirubakaran is on a distinguished road

      0  

    Default


    You need to listen for the field focus event to select the text.
    Code:
    listeners:{
    focus: function(e, opts){
    e.selectText(); return true;
    }
    }

  4. #3
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    In your textfield config, you can also specify:

    Code:
    {
      xtype: 'textfield',
      selectOnFocus: true
    }

Thread Participants: 2