flexlayout-react
    Preparing search index...

    Interface ILayoutApi

    interface ILayoutApi {
        addTabToActiveTabSet(json: ITabAttributes): TabNode | undefined;
        addTabToTabSet(tabsetId: string, json: ITabAttributes): TabNode | undefined;
        addTabWithDragAndDrop(
            event: DragEvent,
            json: ITabAttributes,
            onDrop?: (node?: Node, event?: DragEvent<HTMLElement>) => void,
        ): void;
        getRootDiv(): HTMLDivElement | null | undefined;
        moveTabWithDragAndDrop(event: DragEvent, node: TabNode | TabSetNode): void;
        redraw(): void;
        setDragComponent(
            event: DragEvent,
            component: ReactNode,
            x: number,
            y: number,
        ): void;
    }
    Index

    Methods

    • Adds a new tab to the active tabset (if there is one)

      Parameters

      Returns TabNode | undefined

      the added tab node or undefined

    • Adds a new tab to the given tabset

      Parameters

      • tabsetId: string

        the id of the tabset where the new tab will be added

      • json: ITabAttributes

        the json for the new tab node

      Returns TabNode | undefined

      the added tab node or undefined

    • Adds a new tab by dragging an item to the drop location, must be called from within an HTML drag start handler. You can use the setDragComponent() method to set the drag image before calling this method.

      Parameters

      • event: DragEvent

        the drag start event

      • json: ITabAttributes

        the json for the new tab node

      • OptionalonDrop: (node?: Node, event?: DragEvent<HTMLElement>) => void

        a callback to call when the drag is complete

      Returns void

    • Get the root div element of the layout

      Returns HTMLDivElement | null | undefined

    • Move a tab/tabset using drag and drop, must be called from within an HTML drag start handler

      Parameters

      • event: DragEvent

        the drag start event

      • node: TabNode | TabSetNode

        the tab or tabset to drag

      Returns void

    • re-render the layout

      Returns void

    • Sets the drag image from a react component for a drag event

      Parameters

      • event: DragEvent

        the drag event

      • component: ReactNode

        the react component to be used for the drag image

      • x: number

        the x position of the drag cursor on the image

      • y: number

        the x position of the drag cursor on the image

      Returns void