Skip to content

@serenity-is/sleekgrid / LayoutEngine

Interface: LayoutEngine

Defined in: src/layouts/layout-engine.ts:11

Pluggable layout strategy responsible for creating DOM panes and responding to grid option changes. The grid instantiates one engine (typically BasicLayout or FrozenLayout).

Properties

layoutName

layoutName: string

Defined in: src/layouts/layout-engine.ts:13

Human-readable layout name (e.g. "BasicLayout").


supportFrozenBottom?

optional supportFrozenBottom: boolean

Defined in: src/layouts/layout-engine.ts:46

Whether the engine supports bottom-frozen rows.


supportFrozenRows?

optional supportFrozenRows: boolean

Defined in: src/layouts/layout-engine.ts:44

Whether the engine supports top-frozen rows.


supportPinnedCols?

optional supportPinnedCols: boolean

Defined in: src/layouts/layout-engine.ts:40

Whether the engine supports pinned (frozen) columns.


supportPinnedEnd?

optional supportPinnedEnd: boolean

Defined in: src/layouts/layout-engine.ts:42

Whether the engine supports end-pinned columns.

Methods

adjustFrozenRowsOption()?

optional adjustFrozenRowsOption(): void

Defined in: src/layouts/layout-engine.ts:25

Adjusts the frozen-row refs from the current grid options without a full re-layout. Called when frozenRows / frozenBottom change.

Returns

void


afterSetOptions()

afterSetOptions(args): void

Defined in: src/layouts/layout-engine.ts:30

Called after grid.setOptions(args) merges new options.

Parameters

args

GridOptions

Options delta passed to setOptions.

Returns

void


destroy()

destroy(): void

Defined in: src/layouts/layout-engine.ts:20

Tears down DOM and listeners created by LayoutEngine.init.

Returns

void


init()

init(host): void

Defined in: src/layouts/layout-engine.ts:18

Initializes the layout, creating DOM inside host.getContainerNode().

Parameters

host

LayoutHost

Layout host providing grid state, signals and refs.

Returns

void


reorderViewColumns()?

optional reorderViewColumns(viewCols, refs): Column<any>[]

Defined in: src/layouts/layout-engine.ts:38

Optionally reorders the visible columns before they are laid out. May be called before LayoutEngine.init during early option setup.

Parameters

viewCols

Column<any>[]

Current visible columns in display order.

refs

GridLayoutRefs

Mutable layout refs whose config may be updated.

Returns

Column<any>[]

Reordered columns, or null when no reorder is needed.