Select 在EditorGridPanel(gwt ext)中单击选择文本

Select 在EditorGridPanel(gwt ext)中单击选择文本,select,cell,gwt-ext,gridpanel,Select,Cell,Gwt Ext,Gridpanel,我有一个gwt ext EditorGridPanel,通过单击单元格,可以编辑其值。光标放在单元格的开头,但如果用户单击该单元格,我希望选择该单元格中的整个文本。你知道我怎么处理吗 我尝试了一些听众等,但没有一个对我有效。对不起,我的英语,有了Ext GWT(GXT),可以这样做: final TextField<String> text = new TextField<String>(); text.setAllowBlank(false); Cell

我有一个gwt ext EditorGridPanel,通过单击单元格,可以编辑其值。光标放在单元格的开头,但如果用户单击该单元格,我希望选择该单元格中的整个文本。你知道我怎么处理吗


我尝试了一些听众等,但没有一个对我有效。

对不起,我的英语,有了Ext GWT(GXT),可以这样做:

final TextField<String> text = new TextField<String>();
    text.setAllowBlank(false);
    CellEditor textEditor = new CellEditor(text);
    textEditor.addListener(Events.StartEdit, new Listener<EditorEvent>() {
      public void handleEvent(EditorEvent be) {
        text.setSelectOnFocus(true);
      }
    });
    column.setEditor(textEditor);
    configs.add(column);
final TextField text=new TextField();
text.setAllowBlank(false);
CellEditor textEditor=新的CellEditor(文本);
textEditor.addListener(Events.StartEdit,new Listener(){
公共无效handleEvent(EditorEvent be){
text.setSelectOnFocus(true);
}
});
column.setEditor(textEditor);
添加(列);

只要在GWT Ext中找到方法,我想会有这样的事情……我希望这有帮助……

对不起,我的英语,有了Ext GWT(GXT)它可以做到:

final TextField<String> text = new TextField<String>();
    text.setAllowBlank(false);
    CellEditor textEditor = new CellEditor(text);
    textEditor.addListener(Events.StartEdit, new Listener<EditorEvent>() {
      public void handleEvent(EditorEvent be) {
        text.setSelectOnFocus(true);
      }
    });
    column.setEditor(textEditor);
    configs.add(column);
final TextField text=new TextField();
text.setAllowBlank(false);
CellEditor textEditor=新的CellEditor(文本);
textEditor.addListener(Events.StartEdit,new Listener(){
公共无效handleEvent(EditorEvent be){
text.setSelectOnFocus(true);
}
});
column.setEditor(textEditor);
添加(列);

只要在GWT Ext中找到路,我想会是这样的…..我希望这有帮助….

快速精确:您可以直接使用text.setSelectOnFocus而不等待StartEdit事件,或者您必须在单元格上至少单击一次才能执行此方法快速精确:您可以直接使用text.setSelectOnFocus而不等待StartEdit事件,或者您必须单击在单元格上至少执行一次以执行此方法