ASP.NET Core MVC Controls | ComponentOne
In This Topic
    DisposableObject Class
    In This Topic
    File
    c1.nav.js
    Module
    c1.nav
    Derived Classes
    LayoutBase, LayoutItem

    Base class for the disposable objects in dashboardlayout.

    The object also provides a set of methods to attach and remove the events on the dom elements.

    Methods

    addEventListener

    addEventListener(target: EventTarget, type: string, fn: any, capture?: boolean): void
    

    Adds an event listener to an element owned by this Control.

    The control keeps a list of attached listeners and their handlers, making it easier to remove them when the control is disposed (see the dispose and removeEventListener methods).

    Failing to remove event listeners may cause memory leaks.

    Parameters
    • target: EventTarget

      Target element for the event.

    • type: string

      String that specifies the event.

    • fn: any

      Function to execute when the event occurs.

    • capture: boolean Optional

      Whether the listener is capturing.

    Returns
    void

    dispose

    dispose(fullDispose?: boolean): void
    

    Disposes the object.

    Parameters
    • fullDispose: boolean Optional

      If true, all the related resources are disposed.

    Returns
    void

    removeEventListener

    removeEventListener(target?: EventTarget, type?: string, fn?: any, capture?: boolean): number
    

    Removes one or more event listeners attached to elements owned by this Control.

    Parameters
    • target: EventTarget Optional

      Target element for the event. If null, removes listeners attached to all targets.

    • type: string Optional

      String that specifies the event. If null, removes listeners attached to all events.

    • fn: any Optional

      Handler to remove. If null, removes all handlers.

    • capture: boolean Optional

      Whether the listener is capturing. If null, removes capturing and non-capturing listeners.

    Returns
    number