Jump to content
uniGUI Discussion Forums
Cebola

Selecionar texto ao editar no grid

Recommended Posts

I would like to know how when editing in a cell in the grid would have like the text to be edited, to be selected.

 

-> When editing, select all cell contents

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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,

Share this post


Link to post
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,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×