RAMP4 - v4.21.0
    Preparing search index...

    Class EventAPI

    A base class for anything requiring access to the InstanceApi and instance of Vue app controlled by it.

    APIScope

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    The instance of RampMap API scoped to a single Vue R4MP application.

    APIScope

    Accessors

    • get $element(): App<Element>

      Returns App<Element>

    • get $vApp(): ComponentPublicInstance

      The instance of Vue R4MP application controlled by this InstanceAPI. This is just a shorthand for this.$iApi.$vApp.

      Returns ComponentPublicInstance

      APIScope

    Methods

    • Returns any active event handlers, filtered to an event name if desired.

      Parameters

      • Optionalevent: string = ''

        name of the event. Omission will return all active handlers

      Returns string[]

      list of handler names

      EventAPI

    • Loads the set of standard, built-in event handlers to the R4MP Vue instance. This will quickly set up the vanilla version of RAMP. Note this function is automatically run by the instance startup unless the loadDefaultEvents option is set to false. The function is exposed to allow custom pages the ability to call it at a different point in the startup. Also, a subset of standard event handlers can be provided on the optional parameter if one wishes to omit some of the standard handlers.

      Parameters

      • OptionaleventHandlerNames: string[]

        list of built-in event handler names to add. omission means all built-in event handlers will be added

      Returns string[]

      resolves with array of event handler names

      EventAPI

    • Triggers an event.

      Parameters

      • event: string

        the name of the event

      • ...args: any[]

        any arguements the event is expecting

      Returns void

      EventAPI

    • A list of event names that have been registered with the bus.

      Returns string[]

      list of event names

      EventAPI

    • Removes an event handler from an event.

      Parameters

      • handlerName: string

        name of the handler to remove

      Returns void

      EventAPI

    • Removes all event handlers, filtered to an event name if desired.

      Parameters

      • Optionalevent: string = ''

        name of the event. Omission will remove all handlers for all events

      Returns void

    • Adds an event handler to an event.

      Parameters

      • event: string

        name of the event to react to

      • callback: (...args: any[]) => void

        function to execute when event triggers

      • OptionalhandlerName: string = ''

        name of the handler (for reference). a name will be generated if not provided.

      Returns string

      the handler name

      EventAPI

    • Adds an event handler to an event that will be respected once. After the handler reacts to the event, it will be removed.

      Parameters

      • event: string

        name of the event to react to once

      • callback: (args: any[]) => void

        function to execute when event triggers

      • OptionalhandlerName: string = ''

        name of the handler (for reference). a name will be generated if not provided.

      Returns string

      the handler name

      EventAPI

    • Adds event names to the names registry of the event bus.

      Parameters

      • names: string | string[]

        event names or names to register

      Returns void

      EventAPI

    • Removes all default event handlers.

      Returns void