开发者

Editor Grid Keyboard Navigation - Enable editing without clicking with mouse

I have an editor grid that is populated using XML static data. Using the TAB key, I need to be able to navigate between the sections of content, until finally arriving t开发者_Go百科o the inside of the editor grid. This part works fine.

However, the default behavior demands that the use hit the Enter key to begin editing the field. Is there any way to enable editing on the custom editor (TextField) when the user TAB's into a cell? The grid's config already has clicksToEdit set to 1.

I have attempted to set up a cellSelectionModel with a listener on the selectionchanged event. This code fails when using the mouse as well.

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.
        }
    }
})

Does anyone have any ideas on how to approach enabling the custom editor when tabbing into th field with the keyboard?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜