AboutSupportDeveloper GuideVersion 47.154.100.2
OpenFin JavaScript API
    Preparing search index...

    Interface CreateLayoutOptionsExperimental

    interface CreateLayoutOptions {
        accessibilityOptions?: LayoutAccessibilityOptions;
        container: HTMLElement;
        layout: LayoutOptions;
        layoutName: string;
        multiInstanceViewBehavior?: MultiInstanceViewBehavior;
        renderCustomHeaderControls?: (
            controlsElement: HTMLElement,
            context: HeaderControlsContext,
        ) => void | (() => void);
        renderCustomTabControls?: (
            tabElement: HTMLElement,
            context: CustomTabControlsContext,
        ) => void | (() => void);
    }
    Index
    accessibilityOptions?: LayoutAccessibilityOptions

    Accessibility options for the layout. Controls ARIA attributes and keyboard navigation.

    container: HTMLElement
    layoutName: string
    multiInstanceViewBehavior?: MultiInstanceViewBehavior

    Controls the View behavior for the given layout property. Note that the selected behavior only applies to unnamed Views or Views with the prefix internal-generated-. In all cases, if any View in the layout does not already exist, it will be created with a name that starts with internal-generated-.

    When set to reparent, Views prefixed with internal-generated- will be reparented to the current Window and added to this new Layout. Use this option when you need to transfer an existing Layout between Windows.

    When set to 'duplicate', Views prefixed with internal-generated- will be duplicated with new generated names. Use this option when you need to clone a Layout to any Window.

    When set to default or omitted, the Layout will attempt to re-use existing Views only if they are attached to the current Window or the Provider Window. Set to default or omit this option when creating Layouts as part of implementing the LayoutManager::applyLayoutSnapshot override. Note that during applyLayoutSnapshot, Views are created and attached to the Provider while the Window is being created, so it's important to not 'duplicate' Views in this workflow.

    'default'
    
    renderCustomHeaderControls?: (
        controlsElement: HTMLElement,
        context: HeaderControlsContext,
    ) => void | (() => void)

    Callback invoked for each stack when its header controls area is rendered. The callback receives the .lm_controls DOM element and a context object with a getStack() async getter. Use this to inject custom controls (e.g. search buttons) into stack headers.

    Optionally return a cleanup function that will be called when the stack is destroyed.

    Custom controls are not serialized into snapshots since callbacks are not serializable. The callback is re-invoked when layouts are restored.

    NOTE: This feature is currently only supported in OpenFin Runtime environments.

    Type Declaration

      • (
            controlsElement: HTMLElement,
            context: HeaderControlsContext,
        ): void | (() => void)
      • Parameters

        Returns void | (() => void)

        A callback to be called when the rendered element needs to be cleaned up.

    renderCustomTabControls?: (
        tabElement: HTMLElement,
        context: CustomTabControlsContext,
    ) => void | (() => void)

    Callback invoked once per tab after core has finished building the tab DOM. Use this to inject custom controls (e.g. action icons) into view tab hats.

    Optionally return a cleanup function that will be called when the tab is destroyed.

    Custom controls are not serialized into snapshots since callbacks are not serializable. The callback is re-invoked when tabs are recreated.

    NOTE: This feature is only supported with layout engine 'v2' (GL2) and settings.tabOverflowBehavior: 'scroll'.

    Optionally add the lm_tab_custom_control class to each injected control as a direct child of tabElement. That opts the control into LayoutAccessibilityOptions keyboard navigation (roving tabindex, arrow keys in DOM order, Enter/Space without switching tabs), pointer isolation so clicks do not activate or close the tab (press-and-drag still reorders/tears out tab, matching the close button), and default 20×20 flex sizing (override using --layout-tab-custom-control-size).

    Type Declaration

      • (
            tabElement: HTMLElement,
            context: CustomTabControlsContext,
        ): void | (() => void)
      • Parameters

        • tabElement: HTMLElement

          The .lm_tab DOM element for the view tab.

        • context: CustomTabControlsContext

          Context object with DOM anchors for the tab.

        Returns void | (() => void)

        A callback to be called when the rendered elements need to be cleaned up.