Jump to content


Photo

Selecionar texto ao editar no grid

unigui Grid

  • Please log in to reply
6 replies to this topic

#1 Cebola

Cebola

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 04 September 2017 - 06:52 PM

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


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3038 posts

Posted 07 September 2017 - 05:39 PM

Hi,

 

Can you clarify your question again please ?

 

Best regards,


  • 0

#3 Cebola

Cebola

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 08 September 2017 - 04:12 PM

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.


  • 0

#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3038 posts

Posted 08 September 2017 - 05:00 PM

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,


  • 0

#5 Cebola

Cebola

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 08 September 2017 - 07:14 PM

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


  • 0

#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3038 posts

Posted 11 September 2017 - 05:56 AM

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,


  • 0

#7 Cebola

Cebola

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 11 September 2017 - 07:05 PM

It did not work ... but it helped me a lot! Thank you!


  • 0





Also tagged with one or more of these keywords: unigui, Grid

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users