← DataGrid API

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>

title

Optional tooltip/title for the header cell; defaults to header text.

title?: string

cellTitle

Optional tooltip/title for body cells; defaults to the cell text.

cellTitle?: string | ((row: T) => string)

sortable

enable clicking to sort

sortable?: boolean

filterable

enable filtering on this column

filterable?: boolean

filterType

filterType?: NgbColumnFilterType

defaultFilterOperator

When `''`, the first entry from allowedFilterOperators or the type list is used.

defaultFilterOperator?: NgbFilterOperator | ''

allowedFilterOperators

allowedFilterOperators?: NgbFilterOperator[]

showFilterMenu

showFilterMenu?: boolean

showFilterRow

showFilterRow?: boolean

showFilterOperator

When `false`, hides the operator-list trigger in row filter mode.

showFilterOperator?: boolean

filterPlaceholder

Placeholder for the row filter input; defaults to a type-specific label.

filterPlaceholder?: string

editable

editable?: boolean | ((row: T, isNew: boolean) => boolean)

type

type?: ColumnType

options

options?: Array<{ label: string; value: unknown; }>

width

width?: number

stackedGroup

Groups cells in stacked card layout (`tableOptions.stackedLayout = 'cards'`).

stackedGroup?: 'start' | 'center' | 'end'

hidden

hidden?: boolean

sticky

sticky?: boolean | 'start' | 'end'

locked

locked?: boolean

reorderable

reorderable?: boolean

resizable

When grid `[resizable]` is true, set to `false` to disable resizing for this column.

resizable?: boolean

minResizableWidth

Minimum width (px) while resizing; defaults to 50 when resizing is enabled.

minResizableWidth?: number

maxResizableWidth

Maximum width (px) while resizing.

maxResizableWidth?: number

headerClass

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) => string

clipboardParse

Optional clipboard conversion. Throw to reject a value; receives a detached row.

clipboardParse?: (text: string, row: T) => unknown

required

required?: boolean

Referenced types

Source: types/angular-bootstrap-ngbootstrap.d.ts in the installed @angular-bootstrap/ngbootstrap package. Angular compiler metadata and private members are omitted.

This project is not affiliated with ng-bootstrap or ngx-bootstrap. Those projects focus mainly on Bootstrap components for Angular. ngbootstrap focuses on Angular UI for data-heavy apps, especially Data Grid, Angular-native Form Builder, drag and drop workflows, documentation examples, and performance-focused Angular patterns.