For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/engine/element-api/__GetEvents.md.
Lynx
  • English
  • __GetEvents

    Introduction

    Returns all event listeners of the Element in the form of an array.

    Syntax

    __GetEvents(element: Element) : Array<Record<string, any>>;

    Parameters

    KeyDescription
    elementAny Element object.

    Return Value

    Returns an array of all event listeners for the current Element, where each element in the array is a map that describes a single event listener.

    Example

    The frontend framework can retrieve the event listeners of an Element as follows.

    // main-thread.js
    let element = __CreateElement('view', 0, {});
    __SetAttribute(element, 'src', 'xx');
    
    __SetEvents(element, [{ type: 'bindEvent', name: 'tap', function: 'onTap' }]);
    
    let listeners = __GetEvents(element);
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.