Class Flyout

Displays lightweight UI that is either information, or requires user interaction. Unlike a dialog, a Flyout can be light dismissed by clicking or tapping off of it.

Index

Constructor methods

Properties

Methods

Constructor methods

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

Creates a new Flyout 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 Flyout.

Returns

Flyout

Properties

public alignment: string

Gets or sets the default alignment to be used for this Flyout.

public anchor: HTMLElement

Gets or sets the default anchor to be used for this Flyout.

public element: HTMLElement

Gets the DOM element that hosts the Flyout.

public hidden: boolean

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

public placement: string

Gets or sets the default placement to be used for this Flyout.

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()

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

public hide()

Hides the Flyout, if visible, regardless of other states.

public onafterhide(eventInfo: Event)

Raised immediately after a flyout is fully hidden.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

public onaftershow(eventInfo: Event)

Raised immediately after a flyout is fully shown.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

public onbeforehide(eventInfo: Event)

Raised just before hiding a flyout.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

public onbeforeshow(eventInfo: Event)

Raised just before showing a flyout.

Parameters

  • eventInfo: Event

    An object that contains information about the event.

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.

public show(anchor: HTMLElement, placement: string, alignment: string)

Shows the Flyout, if hidden, regardless of other states.

Parameters

  • anchor: HTMLElement

    Required. The DOM element to anchor the Flyout.

  • placement: string

    The placement of the Flyout to the anchor: the string literal "top", "bottom", "left", or "right".

  • alignment: string

    For "top" or "bottom" placement, the alignment of the Flyout to the anchor's edge: the string literal "center", "left", or "right".