@serenity-is/sleekgrid / Column
Interface: Column<TItem>
Defined in: src/core/column.ts:10
Definition of a single grid column.
Type Parameters
TItem
TItem = any
Row item type the column belongs to.
Properties
asyncPostRender?
optionalasyncPostRender:AsyncPostRender<TItem>
Defined in: src/core/column.ts:12
Async post-render hook invoked after the cell node is attached to the DOM.
asyncPostRenderCleanup?
optionalasyncPostRenderCleanup:AsyncPostCleanup<TItem>
Defined in: src/core/column.ts:14
Cleanup counterpart to asyncPostRender; called before the node is removed or re-rendered.
behavior?
optionalbehavior:any
Defined in: src/core/column.ts:16
Arbitrary behavior token consumed by plugins (e.g. "selectAndMove").
cannotTriggerInsert?
optionalcannotTriggerInsert:boolean
Defined in: src/core/column.ts:18
When true, editing this column cannot trigger insertion of a new row.
cssClass?
optionalcssClass:string
Defined in: src/core/column.ts:20
CSS class(es) applied to every body cell in this column.
defaultSortAsc?
optionaldefaultSortAsc:boolean
Defined in: src/core/column.ts:22
Default sort direction for this column; true means ascending.
editor?
optionaleditor:EditorClass
Defined in: src/core/column.ts:24
Editor class used when the cell enters edit mode.
editorFixedDecimalPlaces?
optionaleditorFixedDecimalPlaces:number
Defined in: src/core/column.ts:26
Fixed number of decimal places the editor should preserve (if applicable).
field?
optionalfield:string
Defined in: src/core/column.ts:28
Property name on TItem that this column is bound to.
focusable?
optionalfocusable:boolean
Defined in: src/core/column.ts:32
Whether cells in this column can receive focus. Defaults to true.
footerCssClass?
optionalfooterCssClass:string
Defined in: src/core/column.ts:34
CSS class(es) applied to footer row cells in this column.
format?
optionalformat:ColumnFormat<TItem>
Defined in: src/core/column.ts:36
Modern formatter for body cells. Prefer this over the deprecated formatter.
formatter?
optionalformatter:CompatFormatter<TItem>
Defined in: src/core/column.ts:41
Legacy formatter for body cells.
Deprecated
Use Column.format instead.
frozen?
optionalfrozen:boolean|"end"|"start"
Defined in: src/core/column.ts:30
Freezing / pinning of the column. true/"start" pins to the start side, "end" to the end side.
groupTotalsFormat()?
optionalgroupTotalsFormat: (ctx) =>FormatterResult
Defined in: src/core/column.ts:43
Formatter used to render group-totals rows for this column.
Parameters
ctx
FormatterContext<IGroupTotals<TItem>>
Returns
groupTotalsFormatter()?
optionalgroupTotalsFormatter: (totals?,column?,grid?) =>string
Defined in: src/core/column.ts:48
Legacy group-totals formatter.
Parameters
totals?
IGroupTotals<TItem>
column?
Column<TItem>
grid?
unknown
Returns
string
Deprecated
Use Column.groupTotalsFormat instead.
headerCssClass?
optionalheaderCssClass:string
Defined in: src/core/column.ts:50
CSS class(es) applied to the header cell.
id?
optionalid:string
Defined in: src/core/column.ts:52
Unique column identifier. Auto-generated from field or a fallback if omitted.
maxWidth?
optionalmaxWidth:any
Defined in: src/core/column.ts:54
Maximum pixel width the column may be resized to.
minWidth?
optionalminWidth:number
Defined in: src/core/column.ts:56
Minimum pixel width the column may be resized to.
name?
optionalname:string
Defined in: src/core/column.ts:58
Display name shown in the header. Defaults to a titleized form of field/id.
nameFormat()?
optionalnameFormat: (ctx) =>FormatterResult
Defined in: src/core/column.ts:60
Formatter used to render the header name content.
Parameters
ctx
FormatterContext<TItem>
Returns
previousWidth?
optionalpreviousWidth:number
Defined in: src/core/column.ts:62
Previous width before the last resize; managed internally for forceFitColumns.
referencedFields?
optionalreferencedFields:string[]
Defined in: src/core/column.ts:64
Extra field names the column depends on (besides field), used for dirty tracking.
rerenderOnResize?
optionalrerenderOnResize:boolean
Defined in: src/core/column.ts:66
When true, cells are re-rendered on column resize.
resizable?
optionalresizable:boolean
Defined in: src/core/column.ts:68
Whether the column can be resized by dragging its header border.
selectable?
optionalselectable:boolean
Defined in: src/core/column.ts:70
Whether cells in this column can be selected.
sortable?
optionalsortable:boolean
Defined in: src/core/column.ts:74
Whether clicking the header sorts by this column.
sortOrder?
optionalsortOrder:number
Defined in: src/core/column.ts:76
Sort priority when multiple columns are sorted; lower numbers sort first.
tabbable?
optionaltabbable:boolean
Defined in: src/core/column.ts:72
Whether cells in this column participate in tab navigation.
toolTip?
optionaltoolTip:string
Defined in: src/core/column.ts:78
Tooltip text for the header cell.
validator()?
optionalvalidator: (value,editorArgs?) =>ValidationResult
Defined in: src/core/column.ts:85
Optional validator invoked by the editor.
Parameters
value
any
The value to validate.
editorArgs?
any
Additional editor context, if any.
Returns
Validation result indicating validity and an optional message.
visible?
optionalvisible:boolean
Defined in: src/core/column.ts:87
Whether the column is currently visible. Columns with visible: false are hidden but retained.
width?
optionalwidth:number
Defined in: src/core/column.ts:89
Current pixel width of the column.