PDA

View Full Version : EditorGrid setting tab Order on cells



Matt Kleweno
11 May 2009, 10:42 AM
I have an editorGrid in which i want to set the tab order on the cells after the grid is rendered.

how do i do this?

Animal
11 May 2009, 11:21 PM
Override the onEditorKey method in your selection model.

That's the method which is passed a key event, and decides where to go next. Currently it's as below, but you can either poke in your own implementation, or create a subclass.



onEditorKey : function(field, e){
var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
if(k == e.TAB){
if(e.shiftKey){
newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
}else{
newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
}
e.stopEvent();
}else if(k == e.ENTER){
ed.completeEdit();
e.stopEvent();
}else if(k == e.ESC){
e.stopEvent();
ed.cancelEdit();
}
if(newCell){
g.startEditing(newCell[0], newCell[1]);
}
}

Matt Kleweno
12 May 2009, 7:37 AM
I need to do this in EXT GWT not JS. I guess I should have stated that more clearly.

Is there a way to do what you have listed below in EXT GWT? I am new to both.

12 May 2009, 7:37 AM
...... OR posted in the Ext GWT forums perhaps .....

Matt Kleweno
12 May 2009, 7:39 AM
My mistake...I thought that is where I posted this question originally.