Class NavBarCommand

Represents a navigation command in a NavBarContainer.

Index

Constructor methods

Properties

Methods

Constructor methods

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

Creates a new NavBarCommand.

constructor

Parameters

  • element?: HTMLElement optional

    The DOM element hosts the new NavBarCommand.

  • options?: any optional

    An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events.

Returns

NavBarCommand

Properties

public element: HTMLElement

Gets the HTML element that hosts this NavBarCommand.

public icon: string

Gets or sets the command's icon.

public label: string

Gets or sets the label of the command.

public location: any

Get or sets the location to navigate to when this command is invoked.

public splitButton: boolean

Gets or sets a value that specifies whether to show the split tab stop.

public splitOpened: boolean

Gets a value that indicates whether the splitButton is open.

public state: any

Gets or sets a user-defined object that represents the state associated with the command's location.

public tooltip: any

Gets or sets the tooltip of the command.

Methods

public addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean)

Registers an event handler for the specified event.

Parameters

  • eventName: string

    The name of the event to handle. Note that you drop the "on" when specifying the event name. For example, instead of specifying "onclick", you specify "click".

  • eventHandler: 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 dispatchEvent(type: string, eventProperties: any): boolean

Raises an event of the specified type and with additional properties.

Parameters

  • type: string

    The type (name) of the event.

  • eventProperties: any

    The set of additional properties to be attached to the event object when the event is raised.

Returns

boolean

true if preventDefault was called on the event, otherwise false.

public dispose()

Releases resources held by this NavBarCommand. Call this method when the NavBarCommand is no longer needed. After calling this method, the NavBarCommand becomes unusable.

public removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean)

Removes an event handler that the addEventListener method registered.

Parameters

  • eventName: string

    The name of the event that the event handler is registered for.

  • eventCallback: 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.