Skip to content

@serenity-is/sleekgrid / formatterContext

Function: formatterContext()

formatterContext<TItem>(opt?): FormatterContext<TItem>

Defined in: src/core/formatting.ts:275

Creates a FormatterContext populated with sensible defaults from the grid options and DOMPurify (when available).

Type Parameters

TItem

TItem = any

Row item type.

Parameters

opt?

Partial<Exclude<FormatterContext<TItem>, "addAttrs" | "addClass" | "tooltip">>

Partial context fields to pre-fill; addAttrs/addClass/tooltip are managed by the formatter itself.

Returns

FormatterContext<TItem>

Fully initialized formatter context ready to pass to a ColumnFormat.