编辑器网格键盘导航 - 无需单击鼠标即可进行编辑

时间:2010-12-10 00:35:21

标签: javascript javascript-events extjs

我有一个使用XML静态数据填充的编辑器网格。使用TAB键,我需要能够在内容的各个部分之间导航,直到最终到达编辑器网格的内部。这部分工作正常。

但是,默认行为要求使用按Enter键开始编辑字段。当用户TAB进入单元格时,有没有办法在自定义编辑器(TextField)上启用编辑?网格配置已将clicksToEdit设置为1。

我试图在selectionchanged事件上设置一个带有侦听器的cellSelectionModel。使用鼠标时此代码也会失败。

this.cm = new Ext.grid.CellSelectionModel({
    listeners: { 
        selectionchanged : function(foo, selected) {

          //using the selected.cell[] I can get the cell row and col
          //This next line blows up
          foo.grid.startEditing(selected.cell[0], selected.cell[1]);

          //I want to be able to edit the cell when the user clicks or TAB's into the cell.
        }
    }
})

有没有人对如何在使用键盘标记到字段时启用自定义编辑器有任何想法?

0 个答案:

没有答案