PDA

View Full Version : grid keypress: browser-specific problems



mdmitry
17 May 2010, 7:03 AM
I'm trying to bind some hotkeys to a grid:



var grd = new Ext.grid.EditorGridPanel({
...
selModel: new Ext.grid.RowSelectionModel({
moveEditorOnEnter: false // don't start editing next line
}),
listeners: {
keypress: function(e) {
if (e.getKey() === e.INSERT) add_fn();
if (e.getKey() === e.ENTER) edit_fn(); // start editing selected line
if (e.getKey() === e.F2) ren_fn();
if (e.getKey() === e.DELETE) del_fn();
}
},
...
});
In IE and Opera hotkeys works perfectly.

In Firefox when I start editing a cell then press ENTER, the same cell starts editing again immediately, looks like e.stopEvent() in Editor::onSpecialKey() isn't working.

In Chrome & Safari all hotkeys are messed up:
minus instead of INSERT (45)
dot instead of DELETE (46)
small q instead of F2 (113)
no mapping for ENTER (13)

Any ideas of solutions or workarounds? Thanks.

mdmitry
19 May 2010, 5:00 AM
bump