• 馃搶 THIS FUNCTION IS THE MAIN ENTRY POINT FOR INTERACTING WITH INTREXX CONTROLS 馃搶

    It retrieves the control instance linked to the given key and is useful when you need to interact with a specific control.

    There are two types of controls this function can return:

    • Older Intrexx controls: These controls are managed via a unique control object (UpObject) to interact with the control.
    • Newer Intrexx controls: These controls can be managed directly and therefore, the function will return the HTML of the control.

    Please refer to the documentation of the control you are working with to understand how to interact with it.

    Parameters

    • key: string | HTMLElement

      The key to identify the control. This can be one of the following:

      • GUID: A unique identifier generated for each control.
      • ID: The ID assigned to the control.
      • HTMLElement: The actual HTML element of the control (to get the control object).
    • settings: Partial<ControlContext> = ...

    Returns null | HTMLElement | ControlLike

    The instance of the control associated with the provided key. If no control is found, it returns null.

    Example

    // Retrieve the control using the GUID.
    const myControl = ix.api.dom.getControl("<ELEMENT-GUID>");

    // Retrieve the control using the ID.
    const myControl = ix.api.dom.getControl("myControlID");

    // Retrieve the control using the HTMLElement.
    // This is only relevant when dealing with older controls managed through control objects.
    const controlElement = document.getElementById("myControlID");
    const myControl = ix.api.dom.getControl(controlElement);