PDA

View Full Version : Delete key + IE7



DrZog
23 Apr 2007, 4:35 AM
Is there a bug in the 'keypress' event in IE7?


grid.on('keypress', function(e){
if (e.getKey() == 46){
alert('Delete key pressed');} //Works in FF but does not fire when delete pressed in IE7
});


e.DELETE has the same result.

e.ENTER etc works fine...:-?

PS:UK keyboard, not sure if thats relevant to keycodes though...

BernardChhun
23 Apr 2007, 4:57 AM
I discovered not so long ago while testing key shortcuts that you have to use the "keydown" event for IE.

I use this little If sentence to check it out:


if (Ext.isIE){
console.log('isIE!');
this.grid.on("keydown", this.grilleKeyPress, this, true);
}else{
console.log('isNotIE!');
this.grid.on("keypress", this.grilleKeyPress, this, true);
}

DrZog
23 Apr 2007, 5:00 AM
Nice one BernardChhun...don't you just dig IE ;)

BernardChhun
23 Apr 2007, 6:07 AM
yea I do deeply love that biatch :">