PDA

View Full Version : editorGrid?tab enter??



ak_ext
2 Aug 2009, 7:11 PM
win???ext2.2.1?
EditorGridPanel????????????????
??????????????????

?????????????????????

editor : new fm.TextField({
allowBlank: true,
listeners: {
render: function(c) {
c.getEl().on({
keypress: onKeypress,
keydown: onKeypress,
scope: c
});
???}
}
})

?????
// ??????
function onKeypress (e) {
var k = e.getKey();
if((k == e.TAB) || (k == e.ENTER)) {
e.stopEvent();
}
}
?????????TAB?ENTER??????????????
?????????????????????????????

ygl
2 Nov 2009, 5:31 AM
http://www.extjs.com/forum/showthread.php?t=4888
?????????????????



var grid = new Ext.grid.EditorGridPanel({...})
var sm = grid.getSelectionModel();
sm.onEditorKey=function(field, e){
var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
var shift = e.shiftKey;
if(k == e.TAB){
e.stopEvent();
...
}else if(k == e.ENTER){
e.stopEvent();
...
}else if(k == e.ESC){
ed.cancelEdit();
...
}
...
};