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/__GetEvent.md.
Lynx
  • English
  • __GetEvent

    Introduction

    Returns the event listener specific to the Element.

    Syntax

    __GetEvent(element: Element, name: string, type: string) : string|Function|undefined;

    Parameters

    KeyDescription
    elementAny Element object.
    nameA case-sensitive string representing the event name.
    typeA case-sensitive string representing the event type.

    Return Value

    Returns the event listener for the current Element with the specified name.

    Example

    The frontend framework can retrieve the event listener 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 listener = __GetEvent(element, 'tap', 'bindEvent');
    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.