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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...