AboutSupportDeveloper GuideVersion 45.146.100.30

Interface CreateLayoutOptionsExperimental

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

Properties

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.

The .lm_controls DOM element for the stack header.

Context object providing an async getStack() to retrieve the TabStack instance.

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