To use this mixin, call connectKeyNavHandlers() in
postCreate() and call startupKeyNavChildren() in startup().
It provides normalized keyboard and focusing code for Container
widgets.
|
|
|
_getFirstFocusableChild(
) :
void
Returns first child that can be focused
|
|
|
|
_getNextFocusableChild(
child
: Widget
dir
: Integer
) :
void
Returns the next or previous focusable child, compared
to "child"
Parameter |
Type |
Usage |
Description |
child |
Widget |
required |
The current widget |
dir |
Integer |
required |
* 1 = after
* -1 = before |
|
|
|
|
_getSiblingOfChild(
child
: dijit._Widget
dir
: int
) :
void
Get the next or previous widget sibling of child
Parameter |
Type |
Usage |
Description |
child |
dijit._Widget |
required |
|
dir |
int |
required |
if 1, get the next sibling
if -1, get the previous sibling |
|
|
|
|
_onBlur(
evt
) :
void
Parameter |
Type |
Usage |
Description |
evt |
|
required |
|
|
|
|
|
_onChildBlur(
widget
: dijit._Widget
) :
void
Called when focus leaves a child widget to go
to a sibling widget.
Parameter |
Type |
Usage |
Description |
widget |
dijit._Widget |
required |
|
|
|
|
|
_onContainerFocus(
evt
) :
void
Handler for when the container gets focus
Initially the container itself has a tabIndex, but when it gets
focus, switch focus to first child...
Parameter |
Type |
Usage |
Description |
evt |
|
required |
|
|
|
|
|
_onContainerKeypress(
evt
) :
void
When a key is pressed, if it's an arrow key etc. then
it's handled here.
Parameter |
Type |
Usage |
Description |
evt |
|
required |
|
|
|
|
|
_startupChild(
widget
: dijit._Widget
) :
void
Setup for each child widget
Sets tabIndex=-1 on each child, so that the tab key will
leave the container rather than visiting each child.
Parameter |
Type |
Usage |
Description |
widget |
dijit._Widget |
required |
|
|
|
|
|
addChild(
widget
: dijit._Widget
insertIndex
: int
) :
void
Add a child to our _Container
Inserts specified child widget's dom node as a child of this widget's
container node, and possibly does other processing (such as layout).
Parameter |
Type |
Usage |
Description |
widget |
dijit._Widget |
required |
|
insertIndex |
int |
optional |
|
|
|
|
|
buildRendering(
) :
void
|
|
|
|
connectKeyNavHandlers(
prevKeyCodes
: dojo.keys[]
nextKeyCodes
: dojo.keys[]
) :
void
Call in postCreate() to attach the keyboard handlers
to the container.
Parameter |
Type |
Usage |
Description |
prevKeyCodes |
dojo.keys[] |
required |
|
nextKeyCodes |
dojo.keys[] |
required |
Key codes for navigating to the next child. |
|
|
|
|
destroyDescendants(
preserveDom
: Boolean
) :
void
Destroys all the widgets inside this.containerNode,
but not this widget itself
Parameter |
Type |
Usage |
Description |
preserveDom |
Boolean |
required |
|
|
|
|
|
focus(
) :
void
|
|
|
|
focusChild(
widget
: dijit._Widget
last
: Boolean
) :
void
Focus widget.
Parameter |
Type |
Usage |
Description |
widget |
dijit._Widget |
required |
Reference to container's child widget |
last |
Boolean |
required |
If true and if widget has multiple focusable nodes, focus the
last one instead of the first one |
|
|
|
|
focusFirstChild(
) :
void
Focus the first focusable child in the container.
|
|
|
|
focusNext(
) :
void
|
|
|
|
focusPrev(
) :
void
Focus the last focusable node in the previous widget
|
|
|
|
getChildren(
) :
void
Returns array of children widgets.
Returns the widgets that are directly under this.containerNode.
|
|
|
|
getIndexOfChild(
child
: dijit._Widget
) :
void
Gets the index of the child in this container or -1 if not found
Parameter |
Type |
Usage |
Description |
child |
dijit._Widget |
required |
|
|
|
|
|
hasChildren(
) :
void
Returns true if widget has children, i.e. if this.containerNode contains something.
|
|
|
|
removeChild(
widget
: Widget
) :
void
Removes the passed widget instance from this widget but does
not destroy it. You can also pass in an integer indicating
the index within the container to remove
Parameter |
Type |
Usage |
Description |
widget |
Widget |
required |
or int |
|
|
|
|
startup(
) :
void
Called after all the widgets have been instantiated and their
dom nodes have been inserted somewhere under dojo.doc.body.
Widgets should override this method to do any initialization
dependent on other widgets existing, and then call
this superclass method to finish things off.
startup() in subclasses shouldn't do anything
size related because the size of the widget hasn't been set yet.
|
|
|
|
startupKeyNavChildren(
) :
void
Call in startup() to set child tabindexes to -1
|