// Ext 3.3.1
// added feature: moveEditorOnEnterLikeOnTab
Ext.override(Ext.grid.RowSelectionModel, {
moveEditorOnEnterLikeOnTab: false, // patch
onEditorKey : function(field, e){
var k = e.getKey(),
newCell,
g = this.grid,
last = g.lastEdit,
ed = g.activeEditor,
shift = e.shiftKey,
ae, last, r, c;
if(k == e.TAB){
e.stopEvent();
ed.completeEdit();
if(shift){
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);
}
}else if(k == e.ENTER){
if (this.moveEditorOnEnterLikeOnTab) // patch
{
if(shift){
newCell = g.walkCells(last.row, last.col-1, -1, this.acceptsNav, this);
}else{
newCell = g.walkCells(last.row, last.col+1, 1, this.acceptsNav, this);
}
}
else if(this.moveEditorOnEnter !== false)
{
if(shift){
newCell = g.walkCells(last.row - 1, last.col, -1, this.acceptsNav, this);
}else{
newCell = g.walkCells(last.row + 1, last.col, 1, this.acceptsNav, this);
}
}
}
if(newCell){
r = newCell[0];
c = newCell[1];
this.onEditorSelect(r, last.row);
if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode
ae = g.activeEditor;
if(ae && ae.field.triggerBlur){
// *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method
ae.field.triggerBlur();
}
}
g.startEditing(r, c);
}
}
});