Class RapidContext.Widget.NavigationBar

Extends: RapidContext.Widget

The navigation bar widget class. Used to show step-based progress or location in a tree structure. In both cases, it allows the user to go back to a previous step. The widget uses a <table> HTML element.

Source code: RapidContext_Widget_NavigationBar.js

Class Summary
 
Creates a new navigation bar widget.
Field Summary
 
The maximum position reached when navigating.
 
The path being navigated.
 
The current position in the path (from 0)
Method Summary
 
moveTo(pos, path)
Moves the navigation bar to the specified position in the path.
 
Resets the position and maximum position counters and moves to the first step in the path.
Methods borrowed from class RapidContext.Widget:
addAll, addChildNode, addClass, animate, blurAll, destroy, disable, enable, getChildNodes, hasClass, hide, isDisabled, isHidden, removeAll, removeChildNode, removeClass, setAttrs, setStyle, show, toggleClass, uid
Event Summary
 
Emitted when the navigation position changes.
Class Detail
RapidContext.Widget.NavigationBar(attrs)
Creates a new navigation bar widget.
JavaScript:
var navBar = RapidContext.NavigationBar();
navBar.moveTo(0, ["Step 1", "Step 2", "Step 3"]);
User Interface XML:
<NavigationBar id="navBar" />
<!-- No support for menu items in XML yet -->
Parameters:
{Object} attrs
the widget and node attributes
{Boolean} attrs.hidden Optional
the hidden widget flag, defaults to false
Returns:
{Widget} the widget DOM node
Field Detail
{Number} position
The current position in the path (from 0)

{Number} maxPosition
The maximum position reached when navigating.

{Array} path
The path being navigated.
Method Detail
reset()
Resets the position and maximum position counters and moves to the first step in the path.

moveTo(pos, path)
Moves the navigation bar to the specified position in the path. Optionally a new path may also be provided.
Parameters:
{Number} pos
the new position to move to (from 0)
{Array} path Optional
the new path to navigate
Event Detail
onchange()
Emitted when the navigation position changes. This is triggered either by the user moving forward or backward, or by a call to the moveTo() method. This event signal carries a reference to the widget itself.