PDA

View Full Version : Delete key + IE7


DrZog
04-23-2007, 08: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
04-23-2007, 08: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
04-23-2007, 09:00 AM
Nice one BernardChhun...don't you just dig IE ;)

BernardChhun
04-23-2007, 10:07 AM
yea I do deeply love that biatch :">