PDA

View Full Version : removeKeyListener?



fjanon
3 Aug 2007, 3:15 AM
How can we remove a key listener?

Feature Request: Element.removeKeyListener(keyMap)

Thanks

Fred

fjanon
3 Aug 2007, 3:26 AM
How can we remove a key listener?

Feature Request: Element.removeKeyListener(keyMap)

Thanks

Fred

I found the answer:

var keyMap = elt.addKeyListener(...);
...
// When not needed anymore:

keyMap.disable();
keymap = null; // enable keyMap instance garbage collection

Fred

armaghedon
10 Oct 2007, 10:41 PM
10x very usefull

armaghedon
11 Oct 2007, 4:52 AM
One more question:
Did it work for you?
I have a

loginDialog = new Ext.LayoutDialog("loginDialog", {....}
enterKeyMap = loginDialog.addKeyListener(13, loginSubmit.handler, loginForm);

Any ideeas how to remove this keyListener?