如何模拟鼠标文字选择?

时间:2022-01-27 08:46:06

I am using GWT/GXT. i am using Editable Grid. it has 3 columns. if user navigates from first column to other column using TAB then the text in the column should be selected as below(cell with blue background only for text not for entire cell) so that i can easily delete the text of the cell using Delete or backspace buttons with out selecting the text again. here my question is how to simulate mouse text selection?

我正在使用GWT / GXT。我正在使用可编辑网格。它有3列。如果用户使用TAB从第一列导航到其他列,则应该如下选择列中的文本(仅对于整个单元格的文本,蓝色背景的单元格),以便我可以使用Delete或退格键轻松删除单元格的文本按钮没有再次选择文本。这里我的问题是如何模拟鼠标文本选择?

如何模拟鼠标文字选择?

Thanks!

谢谢!

1 个解决方案

#1


1  

final TextField<String> text = new TextField<String>();
text.setSelectOnFocus(true);
column.setEditor(new CellEditor(text));
configs.add(column); //ColumnConfig

#1


1  

final TextField<String> text = new TextField<String>();
text.setSelectOnFocus(true);
column.setEditor(new CellEditor(text));
configs.add(column); //ColumnConfig