Class MenuCommand

Represents a command to be displayed in a Menu object.

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(element?: HTMLElement, options?: any): MenuCommand

Creates a new MenuCommand object.

constructor

Parameters

  • element?: HTMLElement optional

    The DOM element that will host the control.

  • options?: any optional

    The set of properties and values to apply to the new MenuCommand.

Returns

MenuCommand

Properties

public disabled: boolean

Gets or sets a value that indicates whether the MenuCommand is disabled.

public element: HTMLElement

Gets the DOM element that hosts the MenuCommand.

public extraClass: string

Adds an extra CSS class during construction.

public flyout: Flyout

Gets or sets the Flyout object displayed by this command. The specified flyout is shown when the MenuCommand's button is invoked.

public hidden: boolean

Gets a value that indicates whether the MenuCommand is hidden or in the process of becoming hidden.

public id: string

Gets the element identifier (ID) of the command.

public label: string

Gets or sets the label of the command.

public onclick: Function

Gets or sets the function to be invoked when the command is clicked.

public selected: boolean

Gets or sets the selected state of a toggle button.

public type: string

Gets the type of the command.

Methods

public addEventListener(type: string, listener: Function, useCapture?: boolean)

Registers an event handler for the specified event.

Parameters

  • type: string

    The event type to register. It must be beforeshow, beforehide, aftershow, or afterhide.

  • listener: Function

    The event handler function to associate with the event.

  • useCapture?: boolean optional

    Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase.

public dispose()

Disposes this control.

public removeEventListener(type: string, listener: Function, useCapture?: boolean)

Removes an event handler that the addEventListener method registered.

Parameters

  • type: string

    The event type to unregister. It must be beforeshow, beforehide, aftershow, or afterhide.

  • listener: Function

    The event handler function to remove.

  • useCapture?: boolean optional

    Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler.