一、el
var el =
Ext.get('例如:formname');
var map = new
Ext.KeyMap(el, {
key:
Ext.EventObject.
ENTER,
fn: function(){
event.keyCode=9;
}
});
二、EditGrid,需修改源码
onEditorKey:function (F, E) {
var C = E.getKey(), G, D = this.grid, B = D.activeEditor;
var A = E.shiftKey;
if (C == E.TAB) {
E.stopEvent();
B.completeEdit();
if (A) {
G = D.walkCells(B.row, B.col - 1, -1, this.acceptsNav, this);
} else {
G = D.walkCells(B.row, B.col + 1, 1, this.acceptsNav, this);
}
} else {
if (C == E.ENTER) {
E.stopEvent();
B.completeEdit();
if (this.moveEditorOnEnter !== false) {
if (A) {
//G
= D.walkCells(B.row - 1, B.col, -1, this.acceptsNav,this)
G = D.walkCells(B.row, B.col - 1, -1, this.acceptsNav, this);
} else {
// G
= D.walkCells(B.row + 1, B.col, 1, this.acceptsNav,this)
G = D.walkCells(B.row, B.col + 1, 1, this.acceptsNav, this);
}
}
} else {
if (C == E.ESC) {
B.cancelEdit();
}
}
}
if (G) {
D.startEditing(G[0], G[1]);
}
}
posted on 2008-08-24 12:14
jinn 阅读(2694)
评论(4) 编辑 收藏 所属分类:
Ext