Jump to content

Selecionar texto ao editar no grid


Cebola

Recommended Posts

Sorry I'm using google translate.
I have a Grid that can edit in the cell, when I edit, the pointer is positioned in the last character. I wanted that when editing the text inside the cell was all selected, not to erase all the content with several backspace.

Sorry I'm using google translate. I have a Grid that can edit in the cell, when I edit, the pointer is positioned in the last character. I wanted that when editing the text inside the cell was all selected, not to erase all the content with several backspace.

Link to comment
Share on other sites

Hi,

 

One of the possible solutions:

 

UniDBGrid1 -> ClientEvents -> ExtEvents -> function reconfigure:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var grid = sender;
    for (var i = 0; i < columns.length; i++) {
        if (columns[i].getEditor()) {
            columns[i].getEditor().on('focus', function(field, e) {
                field.focus(true, 50);
            })
        }
    }
}

Best regards,

Link to comment
Share on other sites

Hi,

 

Already solved my problem partially. Pressing the "Enter" key works by double clicking to edit no.

 

ExtJS's focus() method accepts defer (delay) as an argument, so you can try to increase it:

 

field.focus(true, 50); -> field.focus(true, 200);

 

Best regards,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...