Class MenuItem<TMenuItemProps, TMenuProps>

An item within a menus/Menu!Menu.

Type Parameters

Hierarchy (view full)

Implements

Constructors

Properties

_handles: Handles<unknown, ResourceHandle>
_id: string

The unique ID for this entity. Once set, this should never change.

_isToggled: boolean = false
_itemType: string = ItemType.MENU_ITEM

The item type for this entity when it participates in an App.

Do not directly reference this property. Use EventNames and EventTypes helpers from @arcgis/core/Evented.

The factory that will be used whenever a new menu item needs to be created. Applications can supply their own factory to customize menu item creation.

Accessors

  • get canBeToggled(): boolean
  • Determines whether this item supports toggling.

    Returns boolean

  • get hideOnDisable(): boolean
  • Determines whether the item should be hidden when menus/MenuItem!MenuItem.isEnabled is set to false. The default is false.

    Returns boolean

  • set hideOnDisable(value): void
  • Parameters

    • value: boolean

    Returns void

  • get id(): string
  • The unique ID for this entity.

    Returns string

  • get isEnabled(): boolean
  • Determines whether the user is able to select this item.

    Returns boolean

  • set isEnabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isToggled(): boolean
  • Determines whether this item is currently toggled from its initial state. This property is only meaningful if menus/MenuItem!MenuItem.canBeToggled is true. When this property is changed, other properties of the menu item will be swapped with those in "alternate". An item can only be toggled if it has an alternate state.

    Returns boolean

  • get itemType(): string
  • The item type for this entity when it participates in an App.

    Returns string

Methods

  • Called to perform cleanup. Subclasses should override this method rather than destroy() to perform custom cleanup.

    Returns Promise<void>

  • Called after normal initialization. Note: Child items are initialized before this is called.

    Returns Promise<void>

  • A clean-up function that should get called whenever the item is disposed of.

    Returns Promise<void>

  • Initializes the item.

    Returns Promise<void>

  • Swaps the current properties for those in "alternate". If there is no alternate state then an error will be thrown.

    Returns void

  • Creates an item:// URI reference to this entity.

    Returns string