Jx.Menu.SubMenu

Extends: Jx.Menu.Item

Implements: Jx.AutoPosition, Jx.Chrome

A sub menu contains menu items within a main menu or another sub menu.

The structure of a SubMenu is the same as a Jx.Menu.Item with an additional unordered list element appended to the container.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Jx.Menu.SubMenuExtends: Jx.Menu.Item
Properties
subDomObj{HTMLElement} the HTML container for the sub menu.
owner{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs
visibleItem{<Jx.MenuItem>} the visible item within the menu
items{Array} the menu items that are in this sub menu.
Constructor
Jx.SubMenuCreate a new instance of Jx.SubMenu
Functions
setOwnerSet the owner of this sub menu
showShow the sub menu
hideHide the sub menu
addAdd menu items to the sub menu.
insertBeforeInsert a menu item before another menu item.
removeRemove a single menu item from the menu.
deactivateDeactivate the sub menu
isActiveIndicate if this sub menu is active
setActiveSet the active state of the Jx.Menu that contains this sub menu
setVisibleItemSet a sub menu of this menu to be visible and hide the previously visible one.

Properties

subDomObj

{HTMLElement} the HTML container for the sub menu.

owner

{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs

visibleItem

{<Jx.MenuItem>} the visible item within the menu

items

{Array} the menu items that are in this sub menu.

Constructor

Jx.SubMenu

Create a new instance of Jx.SubMenu

Parameters

optionssee Jx.Button.Options

Functions

setOwner

setOwner: function(obj)

Set the owner of this sub menu

Parameters

obj{Object} the owner

show

show: function()

Show the sub menu

hide

hide: function()

Hide the sub menu

add

add : function()

Add menu items to the sub menu.

Parameters

item{<Jx.MenuItem>} the menu item to add.  Multiple menu items can be added by passing multiple arguments to this function.

insertBefore

insertBefore: function(newItem,
targetItem)

Insert a menu item before another menu item.

Parameters

newItem{<Jx.MenuItem>} the menu item to insert
targetItem{<Jx.MenuItem>} the menu item to insert before

remove

remove: function(item)

Remove a single menu item from the menu.

Parameters

item{<Jx.MenuItem} the menu item to remove.

deactivate

deactivate: function(e)

Deactivate the sub menu

Parameters

e{Event} the event that triggered the menu being deactivated.

isActive

isActive: function()

Indicate if this sub menu is active

Returns

{Boolean} true if the Jx.Menu that ultimately contains this sub menu is active, false otherwise.

setActive

setActive: function(isActive)

Set the active state of the Jx.Menu that contains this sub menu

Parameters

isActive{Boolean} the new active state

setVisibleItem

setVisibleItem: function(obj)

Set a sub menu of this menu to be visible and hide the previously visible one.

Parameters

obj{Jx.SubMenu} the sub menu that should be visible
Extends: Jx.Button
Extends: Object
Create a new instance of Jx.SubMenu
setOwner: function(obj)
Set the owner of this sub menu
show: function()
Show the sub menu
hide: function()
Hide the sub menu
add : function()
Add menu items to the sub menu.
insertBefore: function(newItem,
targetItem)
Insert a menu item before another menu item.
remove: function(item)
Remove a single menu item from the menu.
deactivate: function(e)
Deactivate the sub menu
isActive: function()
Indicate if this sub menu is active
setActive: function(isActive)
Set the active state of the Jx.Menu that contains this sub menu
setVisibleItem: function(obj)
Set a sub menu of this menu to be visible and hide the previously visible one.
Mix-in class that provides a method for positioning elements relative to other elements.
A mix-in class that provides chrome helper functions.