我有一个gwt-ext EditorGridPanel,通过点击一个单元格,你可以编辑它的值。光标放在单元格的开头,但如果用户单击它,我希望选中该单元格中的整个文本。你知道我该怎么处理吗?
我尝试了一些侦听器等,但还没有一个对我有效。
发布于 2011-05-17 04:48:40
很抱歉我的英语,使用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);只要在GWT-Ext中找到方法,我想会像这样……我希望这会有帮助……
https://stackoverflow.com/questions/4806530
复制相似问题