Skip to content

@serenity-is/sleekgrid / FormatterContext

Interface: FormatterContext<TItem>

Context object for column formatters. It provides access to the current cell value, row index, column index, etc. Use grid.getFormatterContext() to create a new instance.

Type Parameters

TItem = any

Properties

addAttrs?

optional addAttrs: object

Additional attributes to be added to the cell node.

Index Signature

[key: string]: string

Defined in

core/formatting.ts:14


addClass?

optional addClass: string

Additional classes to be added to the cell node.

Defined in

core/formatting.ts:19


cell?

optional cell: number

The column index of the cell.

Defined in

core/formatting.ts:35


column?

optional column: Column<TItem>

The column definition of the cell.

Defined in

core/formatting.ts:40


grid?

optional grid: any

The grid instance.

Defined in

core/formatting.ts:45


item?

optional item: TItem

The item of the row.

Defined in

core/formatting.ts:50


row?

optional row: number

The row index of the cell.

Defined in

core/formatting.ts:30


tooltip?

optional tooltip: string

Tooltip text to be added to the cell node as title attribute.

Defined in

core/formatting.ts:55


value?

optional value: any

when returning a formatter result, prefer ctx.escape() to avoid script injection attacks!

Defined in

core/formatting.ts:58

Methods

escape()

escape(value?): string

Returns html escaped ctx.value if called without arguments. prefer this over ctx.value to avoid html injection attacks!

Parameters

value?

any

Returns

string

Defined in

core/formatting.ts:25