Class: MenuItem

Cadcorp.UI.MenuItem

A menu item
Parameters:
Name Type Description
config Object Configuration for this object. The config supplied directly extends the control

Members

childMenuVisible

Properties:
Name Type Description
childMenuVisible boolean True if the child menu is visible, otherwise false

dialogId

Properties:
Name Type Description
dialogId string | null The id of a dialog to show when this menu item is clicked

events

Properties:
Name Type Description
events Cadcorp.Util.Events The events object

footerid

Properties:
Name Type Description
footerid string | null The id of the footer element

hasDropDown

Properties:
Name Type Description
hasDropDown boolean True if this menu has a sub menu, otherwise false

id

Properties:
Name Type Description
id string The unique id of this menu item

itemArray

Properties:
Name Type Description
itemArray Array.<Cadcorp.UI.MenuItem> Array of sub menu items

mapId

Properties:
Name Type Description
mapId string | null The id of a map object
Properties:
Name Type Description
menu Object The menu this menu item belongs to

parentMenuItem

Properties:
Name Type Description
parentMenuItem Object The jQuery object for the element that is displayed in the parent menu when this menu item is selected

text

Properties:
Name Type Description
text string The text to display in this menu item

Methods

destroy()

Destroys this menu item

(protected) dialogClosed(eventArgs, ui)

Event handler for dialog closed event
Deactivates the menu when the dialog is closed
Parameters:
Name Type Description
eventArgs Object jQuery event object
ui Object jQuery ui object

getUI() → {Object}

Gets the UI for this menu item
Returns:
A jQuery object that contains this menu item
Type
Object

hideChildItems()

Hides all the sub items of this menu item
Event handler for mouse click event
This function is expected to be overridden in child classes so they can do their own thing when clicked
Parameters:
Name Type Description
eventArgs Object jQuery event object
Event handler for menu deactivated event
This function is expected to be overridden in child classes so they can do their own thing when deactivated
Parameters:
Name Type Description
eventArgs Object jQuery event object

set_tree(tree)

Sets the text representation of the location of this menu item in the menu hierarchy
Parameters:
Name Type Description
tree string The text location of the parent of this menu item

Events

clicked

Click event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.MenuItem The sender of the event