Package: | Roo |
Defined In: | Roo/KeyNav.js. |
Class: | KeyNav |
Provides a convenient wrapper for normalized keyboard navigation. KeyNav allows you to bind
navigation keys to function calls that will get called when the keys are pressed, providing an easy
way to implement custom navigation schemes for any UI component.
The following are all of the possible keys that can be implemented: enter, left, right, up, down, tab, esc,
pageUp, pageDown, del, home, end. Usage:
var nav = new Roo.KeyNav("my-element", {
"left" : function(e){
this.moveLeft(e.ctrlKey);
},
"right" : function(e){
this.moveRight(e.ctrlKey);
},
"enter" : function(e){
this.save();
},
scope : this
});
Options | Defined By | |
---|---|---|
defaultEventAction : String
The method to call on the {link Roo.EventObject} after this KeyNav intercepts a key.
The method to call on the {link Roo.EventObject} after this KeyNav intercepts a key. Valid values are
{link Roo.EventObjectstopEvent}, {link Roo.EventObjectpreventDefault} and {link Roo.EventObjectstopPropagation} (defaults to 'stopEvent') |
Roo.KeyNav | |
disabled : Boolean
True to disable this KeyNav instance (defaults to false)
True to disable this KeyNav instance (defaults to false)
|
Roo.KeyNav | |
forceKeyDown : Boolean
Handle the keydown event instead of keypress (defaults to false).
Handle the keydown event instead of keypress (defaults to false). KeyNav automatically does this for IE since
IE does not propagate special keys on keypress, but setting this to true will force other browsers to also handle keydown instead of keypress. |
Roo.KeyNav |
Method | Defined By | |
---|---|---|
disable
()
Disable this KeyNav
Disable this KeyNav
|
Roo.KeyNav | |
enable
()
Enable this KeyNav
Enable this KeyNav
|
Roo.KeyNav |