Interface · v2.7.0
ColumnDef
Column metadata for the grid, including sorting, filtering, editing, sticky, locked, width, and validation settings.
Import
import type { ColumnDef } from '@angular-bootstrap/ngbootstrap';Declaration
interface ColumnDef<T = any>Properties
field
key of the property on your row object
field: Extract<keyof T, string>header
human‐readable header text
header: stringtitle
Optional tooltip/title for the header cell; defaults to header text.
title?: stringcellTitle
Optional tooltip/title for body cells; defaults to the cell text.
cellTitle?: string | ((row: T) => string)sortable
enable clicking to sort
sortable?: booleanfilterable
enable filtering on this column
filterable?: booleanfilterType
filterType?: NgbColumnFilterTypedefaultFilterOperator
When `''`, the first entry from allowedFilterOperators or the type list is used.
defaultFilterOperator?: NgbFilterOperator | ''allowedFilterOperators
allowedFilterOperators?: NgbFilterOperator[]showFilterMenu
showFilterMenu?: booleanshowFilterRow
showFilterRow?: booleanshowFilterOperator
When `false`, hides the operator-list trigger in row filter mode.
showFilterOperator?: booleanfilterPlaceholder
Placeholder for the row filter input; defaults to a type-specific label.
filterPlaceholder?: stringeditable
editable?: boolean | ((row: T, isNew: boolean) => boolean)type
type?: ColumnTypeoptions
options?: Array<{
label: string;
value: unknown;
}>width
width?: numberstackedGroup
Groups cells in stacked card layout (`tableOptions.stackedLayout = 'cards'`).
stackedGroup?: 'start' | 'center' | 'end'sticky
sticky?: boolean | 'start' | 'end'locked
locked?: booleanreorderable
reorderable?: booleanresizable
When grid `[resizable]` is true, set to `false` to disable resizing for this column.
resizable?: booleanminResizableWidth
Minimum width (px) while resizing; defaults to 50 when resizing is enabled.
minResizableWidth?: numbermaxResizableWidth
Maximum width (px) while resizing.
maxResizableWidth?: numberheaderClass
headerClass?: string | string[] | Record<string, boolean>headerStyle
headerStyle?: Record<string, string | number>cellClass
cellClass?: string | string[] | Record<string, boolean> | ((row: T, rowIndex: number) => string | string[] | Record<string, boolean>)cellStyle
cellStyle?: Record<string, string | number> | ((row: T, rowIndex: number) => Record<string, string | number> | null | undefined)clipboardFormat
Optional clipboard text formatter. Receives a detached row.
clipboardFormat?: (value: unknown, row: T) => stringclipboardParse
Optional clipboard conversion. Throw to reject a value; receives a detached row.
clipboardParse?: (text: string, row: T) => unknownrequired
required?: boolean