# Yahoo! UI Library

### Menu Library

Yahoo! UI Library > menu > YAHOO.widget.MenuBarItem

## 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 <String>` String specifying the text of the menu bar item.
  `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"

#### DISABLED_SUBMENU_INDICATOR_IMAGE_PATH `- final String`

String representing the path to the image to be used for the submenu arrow indicator when the menu bar item is disabled.
Default Value: "nt/ic/ut/alt1/menuarodwn8_dim_1.gif"

#### SELECTED_SUBMENU_INDICATOR_IMAGE_PATH `- final String`

String representing the path to the image to be used for the submenu arrow indicator when the menu bar item is selected.
Default Value: "nt/ic/ut/alt1/menuarodwn8_hov_1.gif"

#### SUBMENU_INDICATOR_IMAGE_PATH `- final String`

String representing the path to the image to be used for the menu bar item's submenu arrow indicator.
Default Value: "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif"

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

`_checkImage, _oAnchor, _oHelpTextEM, _oSubmenu, _oText, browser, CHECKED_IMAGE_ALT_TEXT, CHECKED_IMAGE_PATH, COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT, constructor, CSS_CLASS_NAME, DISABLED_CHECKED_IMAGE_ALT_TEXT, DISABLED_CHECKED_IMAGE_PATH, DISABLED_SUBMENU_INDICATOR_ALT_TEXT, DISABLED_SUBMENU_INDICATOR_IMAGE_PATH, element, EXPANDED_SUBMENU_INDICATOR_ALT_TEXT, groupIndex, imageRoot, IMG_ROOT, IMG_ROOT_SSL, index, isSecure, parent, SELECTED_CHECKED_IMAGE_PATH, SELECTED_SUBMENU_INDICATOR_IMAGE_PATH, srcElement, SUBMENU_INDICATOR_IMAGE_PATH, SUBMENU_TYPE, submenuIndicator, 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 <String>` String specifying the text of the menu bar item.
  `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.

Returns: `void`

#### toString

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

Returns: `String`

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

`_checkDOMNode, _checkString, _createRootNodeStructure, _getFirstElement, _initSubTree, _preloadImage, blur, configChecked, configDisabled, configEmphasis, configHelpText, configSelected, configStrongEmphasis, configSubmenu, configTarget, configText, configURL, destroy, focus, getFirstItemIndex, getNextArrayItem, getNextEnabledSibling, getPreviousArrayItem, getPreviousEnabledSibling, init, initDefaultConfig, initHelpText, removeHelpText, 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, disabled, emphasis, helptext, selected, strongemphasis, submenu, target, text, url`

Copyright © 2006 Yahoo! Inc. All rights reserved.