@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?
optionaladdAttrs:object
Additional attributes to be added to the cell node.
Index Signature
[key: string]: string
Defined in
addClass?
optionaladdClass:string
Additional classes to be added to the cell node.
Defined in
cell?
optionalcell:number
The column index of the cell.
Defined in
column?
optionalcolumn:Column<TItem>
The column definition of the cell.
Defined in
grid?
optionalgrid:any
The grid instance.
Defined in
item?
optionalitem:TItem
The item of the row.
Defined in
row?
optionalrow:number
The row index of the cell.
Defined in
tooltip?
optionaltooltip:string
Tooltip text to be added to the cell node as title attribute.
Defined in
value?
optionalvalue:any
when returning a formatter result, prefer ctx.escape() to avoid script injection attacks!
Defined in
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