API: menu YAHOO.widget.MenuBarItem (YUI Library)

# Yahoo! UI Library

### Menu 2.9.0

Yahoo! UI Library > menu > YAHOO.widget.MenuBarItem
Search:
Filters Show Private Show Protected Show Deprecated

## Class YAHOO.widget.MenuBarItem - extends YAHOO.widget.MenuItem

Creates an item for a menu bar.

### Constructor

YAHOO.widget.MenuBarItem `( p_oObject , p_oConfig )`

Parameters:
  `p_oObject <HTML>` Markup for the menu item content. The markup is inserted into the DOM as HTML, and should be escaped by the implementor if coming from an external source.
  `p_oObject <HTMLLIElement>` Object specifying the `<li>` element of the menu bar item.
  `p_oObject <HTMLOptGroupElement>` Object specifying the `<optgroup>` element of the menu bar item.
  `p_oObject <HTMLOptionElement>` Object specifying the `<option>` element of the menu bar item.
  `p_oConfig <Object>` Optional. Object literal specifying the configuration for the menu bar item. See configuration class documentation for more details.

### Properties

#### CSS_CLASS_NAME - `final String`

String representing the CSS class(es) to be applied to the `<li>` element of the menu bar item.
Default Value: "yuimenubaritem"

#### CSS_LABEL_CLASS_NAME - `final String`

String representing the CSS class(es) to be applied to the menu bar item's `<a>` element.
Default Value: "yuimenubaritemlabel"

#### Properties inherited from YAHOO.widget.MenuItem:

`_oAnchor, _oHelpTextEM, _oOnclickAttributeValue, _oSubmenu, _sClassName, browser, constructor, CSS_CLASS_NAME, CSS_LABEL_CLASS_NAME, element, groupIndex, id, index, parent, srcElement, SUBMENU_TYPE, value`

### Methods

#### init

`void init ( p_oObject , p_oConfig )`
The MenuBarItem class's initialization method. This method is automatically called by the constructor, and sets up all DOM references for pre-existing markup, and creates required markup if it is not already present.

Parameters:
  `p_oObject <HTML>` Markup for the menu item content. The markup is inserted into the DOM as HTML, and should be escaped by the implementor if coming from an external source.
  `p_oObject <HTMLLIElement>` Object specifying the `<li>` element of the menu bar item.
  `p_oObject <HTMLOptGroupElement>` Object specifying the `<optgroup>` element of the menu bar item.
  `p_oObject <HTMLOptionElement>` Object specifying the `<option>` element of the menu bar item.
  `p_oConfig <Object>` Optional. Object literal specifying the configuration for the menu bar item. See configuration class documentation for more details.

#### toString

`String toString ( )`
Returns a string representing the menu bar item.

#### Methods inherited from YAHOO.widget.MenuItem:

`_createKeyListener, _createRootNodeStructure, _dispatchClickEvent, _dispatchDOMClick, _initSubTree, _onSubmenuBeforeHide, addClassNameForState, blur, configChecked, configClassName, configDisabled, configEmphasis, configHelpText, configKeyListener, configOnClick, configSelected, configStrongEmphasis, configSubmenu, configTarget, configText, configURL, destroy, focus, getClassNameForState, getNextEnabledSibling, getNextSibling, getPreviousEnabledSibling, getPreviousSibling, hasFocus, init, initDefaultConfig, removeClassNameForState, toString`

#### Events inherited from YAHOO.widget.MenuItem:

`blurEvent, clickEvent, destroyEvent, focusEvent, keyDownEvent, keyPressEvent, keyUpEvent, mouseDownEvent, mouseOutEvent, mouseOverEvent, mouseUpEvent,`

#### Configuration attributes inherited from YAHOO.widget.MenuItem:

`checked, classname, disabled, emphasis, helptext, keylistener, onclick selected strongemphasis submenu target text url`

Copyright © 2011 Yahoo! Inc. All rights reserved.