如何 select 网格单元格中的所有文本
How to select all the text in a Grid cell
我正在使用 dhtmlxGrid 开发应用程序并有这样的问题:
选中单元格时如何使单元格中的全文被选中?
我的意思是,当我单击单元格并打开编辑器时,我希望选中所有文本,以便我可以将其删除或立即开始编辑。我已经浏览了文档,但还没有找到任何事件或方法。
请尝试将以下代码添加到 select 编辑开始后的所有文本值:
myGrid.attachEvent("onEditCell",function(stage,rowId,colInd){
if (stage==1 && this.editor && this.editor.obj){
this.editor.obj.select();
}
return true
})
我正在使用 dhtmlxGrid 开发应用程序并有这样的问题:
选中单元格时如何使单元格中的全文被选中?
我的意思是,当我单击单元格并打开编辑器时,我希望选中所有文本,以便我可以将其删除或立即开始编辑。我已经浏览了文档,但还没有找到任何事件或方法。
请尝试将以下代码添加到 select 编辑开始后的所有文本值:
myGrid.attachEvent("onEditCell",function(stage,rowId,colInd){
if (stage==1 && this.editor && this.editor.obj){
this.editor.obj.select();
}
return true
})