Skip to content

ngx-datatable

ngx-datatable is the default solution for large and interactive tables. It is open-source software under MIT license and maintained by Siemens.

Usage

It supports sorting, filtering, paging, selection, virtualization, and keyboard interaction, while remaining flexible about data handling.

ngx-datatable

When to use

  • To handle large datasets.
  • When sorting, filtering, paging, or selection is required.
  • To support column reordering.
  • To support empty states (client or server).
  • To support server-side filtering and sorting.
  • To support grouped or tree rows
  • To support row dragging.
  • To support sticky columns.
  • When looking for a free open-source solution.

Code

Note: The ngx-datatable implements change detection based on immutable table data. E.g. when only the content of a particular cell has changed, this change is not detected by the ngx change detection. See also the remark in the ngx-datatable documentation.

Usage

ngx-datatable is an Angular component for presenting large and complex data. The table is designed to be flexible and light. It doesn't make any assumptions about the data or how you filter, sort or page it. Check out the full documentation, demos and the demo code for more information!

Required Packages
import { NgxDatatableModule } from '@siemens/ngx-datatable';
import { SI_DATATABLE_CONFIG, SiDatatableModule, provideSiDatatableConfig } from '@siemens/element-ng/datatable';

// standalone apps
export const APP_CONFIG: ApplicationConfig = {
  providers: [
    ...
    provideSiDatatableConfig()
    // For smaller row heights:
    // provideSiDatatableConfig({rowHeight: SI_DATATABLE_CONFIG.rowHeightSmall})
  ]
};

// module based apps
@NgModule({
  imports: [
    NgxDatatableModule.forRoot(SI_DATATABLE_CONFIG),
    // For smaller row heights:
    // NgxDatatableModule.forRoot({ ...SI_DATATABLE_CONFIG, rowHeight: SI_DATATABLE_CONFIG.rowHeightSmall }),
    SiDatatableModule,
    // ...
  ]
})

Style configuration

No additional configuration is necessary as everything is already provided in the Element theme.

Keyboard interaction

To have the correct keyboard interaction, use the siDatatableInteraction directive.

Right align columns

There is a small but powerful trick how to right align columns with ngx-datatable. Notice how the Age column is right aligned in the example below. In the TypeScript code you can see that the table columns support two properties called headerClass and cellClass that can be used to apply a CSS class to the column header as well as the column's body cells:

{
  headerClass: 'justify-content-end', // right align column header
  cellClass: 'text-align-right-cell' // right align body cell
}

For the headerClass you can use the existing flex utility class justify-content-end to right align the column header. For the cellClass you have to define your own custom class text-align-right-cell and add the following SCSS code in your stylesheet:

::ng-deep {
  // center align datatable cell
  .text-align-right-cell .datatable-body-cell-label {
    flex: 1;
    text-align: end;
  }
}

Striped rows

Add table-striped next to table-element on <ngx-datatable> to distinguish alternating body rows, like the HTML table variant of the same name.

<ngx-datatable class="table-element table-striped">
  <!-- Table content -->
</ngx-datatable>

Striping is based on the row index, so it stays stable while scrolling virtualized rows. Hover, selection and focus states take precedence over the striping.

Client-side paging, sorting and selection options

  • Use class="table-element" on <ngx-datatable>.
  • Use the pagination component as custom footer template with ngx-datatable-footer and map inputs and outputs.

Server-side paging

Datatable component configured for server-side paging and lazy loading.

Vertical scroll

This example shows a table that grows to the maximum available height, using the layout-fixed-height class (see also Content Layouts). The property scrollbarV is used to enable vertical scrolling within the table. Enabling scrollbarVDynamic removes the scrollbar width from the row width only when actually needed.

Infinite scroll

Datatable component configured for server-side virtual paging. The data is loaded in pages from the server.

Empty state

Use the <si-empty-state></si-empty-state> for an empty table.

Selection

Datatable with a selection. Use the datatableInteractionAutoSelect input of the siDatatableInteraction directive to have it automatically select on keyboard navigation.

Filter and sort

Responsive

Fix height

Sticky columns with horizontal scroll

Reordering rows using Angular CDK Drag and Drop

Column management

Resizing

Datatables do have a fixed, automatically updated size, assumed during their initial rendering and refreshed during screen-size changes. However, they are not automatically refreshed in case their parent container changes size. It is the responsibility of a consuming application to invoke a recalculation if such an event occurs. Such a recalculation can be initiated by using the recalculate() function, exposed by the component.

// ...

@ViewChild(DatatableComponent) table?: DatatableComponent;

// ...

resizeTable() {
  setTimeout(() => this.table?.recalculate());
}

Note: For the component to obtain the correct size information, the recalculation has to happen after the actual resizing event. To ensure that, the setTimeout() has to be used.

The recalculation can either be triggered whenever changes on the DOM are made (e.g. when panels are collapsed/expanded) or by using Element's siResizeObserver directive. If you use siResizeObserver directive ensure that you have imported SiResizeObserverDirective in your standalone component or module.

<ngx-datatable (siResizeObserver)="resizeTable()" ...></ngx-datatable>

DatatableComponent API Documentation

Input Properties

Name Type Description
checkRowListChanges
boolean Controls whether the datatable runs an IterableDiffer: IterableDiffer against the rows input on every change detection cycle to detect additions, removals and reorderings that happen in-place on the same array reference.

Enabled by default. Set to false as a performance optimization when you always pass a new rows array reference on updates.
checkRowPropertyChanges
boolean Controls whether each rendered row runs a KeyValueDiffer against its row object on every change detection cycle to detect in-place property mutations (e.g. row.name = 'new' without replacing the row reference).

Enabled by default. Set to false as a performance optimization when row objects are treated as immutable.
columnMode
ColumnMode Column width distribution mode. standard uses configured widths, flex uses the flex-grow algorithm, and force distributes space proportionally.
columns
TableColumn<any>[] Columns to be displayed.
count
number The total count of all rows. Default value: 0
cssClasses
Partial<NgxDatatableCssClasses> CSS class overrides for sort and pager icons.
disableRowCheck
(row: TRow) => boolean A function you can use to check whether you want to disable a row. Example:

(row) =​>
displayCheck
(row: TRow, column: TableColumn, value: any) => boolean A function you can use to check whether you want to show the checkbox for a particular row based on a criteria. Example:

(row, column, value) =​>
enableClearingSortState
boolean A flag to controll behavior of sort states. By default sort on column toggles between ascending and descending without getting removed. Set true to clear sorting of column after performing ascending and descending sort on that column.
externalPaging
boolean If the table should use external paging otherwise its assumed that all data is preloaded.
externalSorting
boolean If the table should use external sorting or the built-in basic sorting.
footerHeight
number The minimum footer height in pixels. Pass falsey for no footer
ghostLoadingIndicator
boolean Show ghost loaders on each cell. Default value: false
groupedRows
Group<TRow>[] This attribute allows the user to set a grouped array in the following format:
[
{groupid=1} [
{id=1 name="test1"},
{id=2 name="test2"},
{id=3 name="test3"}
]},
{groupid=2​>[
{id=4 name="test4"},
{id=5 name="test5"},
{id=6 name="test6"}
]}
]
groupExpansionDefault
boolean A boolean you can use to set the detault behaviour of rows and groups whether they will start expanded or not. If ommited the default is NOT expanded.
groupRowsBy
keyof TRow This attribute allows the user to set the name of the column to group the data with
headerHeight
(number | "auto") The minimum header height in pixels. Pass a falsey for no header
limit
number The page size to be shown. Default value: undefined
loadingIndicator
boolean Show the linear loading bar. Default value: false
messages
Partial<NgxDatatableMessages> Message overrides for localization
(readonly) offsetChange
ModelSignal<number> The current offset ( page - 1 ) shown. Default value: 0
reorderable
boolean Enable/Disable ability to re-order columns by dragging them.
rowClass
(row: TRow) => (string | Record<string, boolean>) A function which is called with the row and should return either: - a string: "class-1 class-2 - a Record: { 'class-1': true, 'class-2': false }
rowDraggable
boolean A flag to enable drag behavior of native HTML5 drag and drop API on rows. If set to true, rowDragEvents will emit dragstart and dragend events.
rowHeight
(number | "auto" | (row: TRow) => number) Height of each row. When virtual scrolling is disabled, use 'auto' for fluid heights. With virtual scrolling enabled, provide a number or a function that calculates each row's height.
rowIdentity
(x: RowOrGroup<TRow>) => unknown This will be used when displaying or selecting rows. when tracking/comparing them, we'll use the value of this fn,

( fn(x) === fn(y) instead of x === y )
rows
((TRow | undefined)[] | null) Rows that are displayed in the table.
scrollbarH
boolean Enable horz scrollbars
scrollbarV
boolean Enable vertical scrollbars
scrollbarVDynamic
boolean Enable vertical scrollbars dynamically on demand. Property scrollbarV needs to be set true too. Width that is gained when no scrollbar is needed is added to the inner table width.
selectAllRowsOnPage
boolean Property to which you can use for determining select all rows on current page or not.
selectCheck
(value: TRow, index: number, array: TRow[]) => boolean A boolean/function you can use to check whether you want to select a particular row based on a criteria. Example:

(selection) =​>
(readonly) selectedChange
ModelSignal<TRow[]> List of row objects that should be represented as selected in the grid. Default value: []
selectionType
SelectionType Type of row selection. Options are:

- single - multi - checkbox - multiClick - cell

For no selection pass a falsey . Default value: undefined
(readonly) sortsChange
ModelSignal<SortPropDir[]> Array of sorted columns by property and type. Default value: []
sortType
SortType Sorting mode. In single mode, sorting a new column replaces existing sorts; in multi mode, it adds an additional column sort.
summaryHeight
number A height of summary row
summaryPosition
string A property holds a summary row position: top/bottom
summaryRow
boolean A flag for switching summary row on / off
swapColumns
boolean Swap columns on re-order columns or move them.
targetMarkerTemplate
TemplateRef<unknown> Template for the target marker of drag target columns.
trackByProp
keyof TRow Property to which you can use for custom tracking of rows. Example: 'name'
treeFromRelation
string Tree from relation
treeToRelation
string Tree to relation
virtualization
boolean A flag for row virtualization on / off

Output Properties

Name Type Description
activate
ActivateEvent<TRow> A cell or row was focused via keyboard or mouse click.
(readonly) offsetChange
ModelSignal<number> The current offset ( page - 1 ) shown. Default value: 0
page
PageEvent The table was paged either triggered by the pager or the body scroll.
reorder
ReorderEvent Columns were re-ordered.
resize
ColumnResizeEvent Column was resized.
rowDragEvents
DragEventData Emits HTML5 native drag events. Only emits dragenter, dragover, drop events by default. Set rowDraggable to true for dragstart and dragend.
scroll
ScrollEvent Body was scrolled typically in a scrollbarV:true scenario.
(readonly) selectedChange
ModelSignal<TRow[]> List of row objects that should be represented as selected in the grid. Default value: []
(readonly) sortsChange
ModelSignal<SortPropDir[]> Array of sorted columns by property and type. Default value: []
tableContextmenu
ContextMenuEvent<TRow> The context menu was invoked on the table. type indicates whether the header or the body was clicked. content contains either the column or the row that was clicked.
treeAction
{ row: TRow, rowIndex: number } A row was expanded ot collapsed for tree

Methods

() => void
Method
Deprecated: No-op. Dimensions are kept current by a ResizeObserver on the host element; this will be removed in a future release.

SiDatatableInteractionDirective API Documentation

selector exported-as
ngx-datatable[siDatatableInteraction] si-datatable-interaction

Input Properties

Name Type Default Description
datatableInteractionAutoSelect
boolean false Automatically select every row or cell that is navigated trough. Is ignored unless selectionType is single or cell .

Types Documentation

Deprecated: The constant ColumnMode should no longer be used. Instead use the value directly:
// old
<ngx-datatable [columnMode]="ColumnMode.force"></ngx-datatable>
// new
<ngx-datatable [columnMode]="'force'"></ngx-datatable>
Column Type
Properties
By default, the property is bound using normal data binding <​span​>{{content}}<​/span​> . If this property is set to true, the property will be bound as <​span [innerHTML]="content" /​> .

DANGER If enabling this feature, make sure the source of the data is trusted. This can be a vector for HTML injection attacks.

bindAsUnsafeHtml?: boolean
Whether the column can automatically resize to fill extra space. Default value: true .
canAutoResize?: boolean
CSS classes to apply to the body cell.
cellClass?: (string | (data: { column: TableColumn<TRow>, group: TRow[], row: TRow, rowHeight: number, value: any }) => (string | Record<string, boolean>))
Template used to render body cells.
cellTemplate?: TemplateRef<CellContext<TRow>>
Custom transformer used to transform ordinary cell values. It receives an object containing the cell value, its row, and its column.
cellValueTransform?: (context: CellValueTransformContext<TRow>) => any
Whether the column displays a selection checkbox. Only applies when selection mode is checkbox .
checkboxable?: boolean
Custom client-side sort comparator. It receives cell values and their respective rows; a standard two-argument comparison function is also supported.
comparator?: (valueA: any, valueB: any, rowA: TRow, rowB: TRow) => number
Whether the column can be dragged to reorder it. Default value: true .
draggable?: boolean
Grow factor relative to other columns. Available extra width is distributed proportionally according to all columns' flexGrow values. Default value: 0 .
flexGrow?: number
Whether the column is frozen to the left. Default value: false .
frozenLeft?: boolean
Whether the column is frozen to the right. Default value: false .
frozenRight?: boolean
Ghost Cell template ref
ghostCellTemplate?: TemplateRef<any>
Whether the header displays a selection checkbox. Only applies when selection mode is checkbox .
headerCheckboxable?: boolean
CSS classes to apply to the header cell.
headerClass?: (string | (data: { column: TableColumn }) => (string | Record<string, boolean>))
Template used to render header cells.
headerTemplate?: TemplateRef<HeaderCellContext>
Is tree displayed on this column
isTreeColumn?: boolean
Maximum column width in pixels.
maxWidth?: number
Minimum column width in pixels.
minWidth?: number
Column label. When omitted, the property value is used and decamelized.
name?: string
Deprecated: For ordinary cells, use cellValueTransform instead.

const column: TableColumn = {
  // before
  pipe: { transform: value => doTransform(value) },
  // after
  cellValueTransform: ({ value, row, column }) => doTransform(value),
}


When using summary rows with a summaryFunc , transform the value returned by it accordingly.

pipe?: PipeTransform
Property used to bind row values. It can be a nested property path or a numeric index.

When omitted, the name is converted to camel case.

prop?: TableColumnProp
Whether the user can manually resize the column. Default value: true .
resizeable?: boolean
Whether row values can be sorted by this column. Default value: true .
sortable?: boolean
Summary function

Null and undefined have different meanings: - undefined will use the default summary function - null will not compute a summary

summaryFunc?: ((cells: any[]) => any | null)
Summary cell template ref
summaryTemplate?: TemplateRef<any>
Width of the tree level indent
treeLevelIndent?: number
Tree toggle template ref
treeToggleTemplate?: any
Default column width in pixels. Default value: 150 .
width?: number
imported from @siemens/ngx-datatable
import
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
Deprecated: The constant SelectionType should no longer be used. Instead use the value directly:
// old
<ngx-datatable [selectionType]="SelectionType.multi"></ngx-datatable>
// new
<ngx-datatable [selectionType]="'multi'"></ngx-datatable>
import
imported from @siemens/ngx-datatable
typeof SortType[ keyof typeof SortType]
Deprecated: The constant SortType should no longer be used. Instead use the value directly:
// old
const sortType: SortType = SortType.single;
// new
const sortType: SortType = 'single';
import
imported from @siemens/ngx-datatable
import
imported from @siemens/ngx-datatable
import
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
import
imported from @siemens/ngx-datatable
import
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
{ flex: "flex", force: "force", standard: "standard" }
Variable
Deprecated: The constant ColumnMode should no longer be used. Instead use the value directly:
// old
<ngx-datatable [columnMode]="ColumnMode.force"></ngx-datatable>
// new
<ngx-datatable [columnMode]="'force'"></ngx-datatable>
import
imported from @siemens/ngx-datatable
{ cell: "cell", checkbox: "checkbox", multi: "multi", multiClick: "multiClick", single: "single" }
Variable
Deprecated: The constant SelectionType should no longer be used. Instead use the value directly:
// old
<ngx-datatable [selectionType]="SelectionType.multi"></ngx-datatable>
// new
<ngx-datatable [selectionType]="'multi'"></ngx-datatable>
{ multi: "multi", single: "single" }
Variable
Deprecated: The constant SortType should no longer be used. Instead use the value directly:
// old
const sortType: SortType = SortType.single;
// new
const sortType: SortType = 'single';
import
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
Column property that indicates how to retrieve this column's value from a row. 'a.deep.value', 'normalprop', 0 (numeric)
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
import
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
import
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
imported from @siemens/ngx-datatable
Constructor
() => {}
Properties
_bodyComponent: any
_bodyElement: any
_defaultColumnWidth: number
To have this available for all components. The Footer itself is not available in the injection context in templates, so we need to get if from here until we have a state service.
_footerComponent: Signal<(DataTableFooterComponent | undefined)>
The shared grid-template-columns definition for the combined css-grid. It is exposed once as a custom property on the scroll container so the header and every body row align to the same column tracks via var() , instead of each row binding its own (identical) template string.
_gridTemplateColumns: Signal<string>
_internalColumns: WritableSignal<TableColumnInternal<any>[]>
_internalGroupedRows: Signal<(Group<TRow>[] | undefined)>
_internalRows: Signal<(TRow | undefined)[]>
_isFixedHeader: Signal<boolean>
_offsetX: number
_rowDefTemplate: Signal<(TemplateRef<any> | undefined)>
This counter is increased, when the rowDiffer detects a change. This will cause an update of _internalRows.
_rowDiffCount: any
The role="table" element. This is the css-grid that owns both the horizontal and vertical scroll (Option A: single scroll container).
_scrollContainer: any
_subscriptions: Subscription[]
A cell or row was focused via keyboard or mouse click.
activate: OutputEmitterRef<ActivateEvent<TRow>>
Returns if all rows are selected.
allRowsSelected: Signal<boolean>
bodyHeight: WritableSignal<number>
cd: any
Controls whether the datatable runs an IterableDiffer: IterableDiffer against the rows input on every change detection cycle to detect additions, removals and reorderings that happen in-place on the same array reference.

Enabled by default. Set to false as a performance optimization when you always pass a new rows array reference on updates.

checkRowListChanges: InputSignalWithTransform<boolean, unknown>
Controls whether each rendered row runs a KeyValueDiffer against its row object on every change detection cycle to detect in-place property mutations (e.g. row.name = 'new' without replacing the row reference).

Enabled by default. Set to false as a performance optimization when row objects are treated as immutable.

checkRowPropertyChanges: InputSignalWithTransform<boolean, unknown>
Column width distribution mode. standard uses configured widths, flex uses the flex-grow algorithm, and force distributes space proportionally.
columnMode: InputSignal<ColumnMode>
Columns to be displayed.
columns: InputSignal<(TableColumn<any>[] | undefined)>
Column templates gathered from ContentChildren if described in your markup.
columnTemplates: Signal<readonly DataTableColumnDirective<TRow>[]>
configuration: Signal<{ cssClasses: { pagerLeftArrow: string, pagerNext: string, pagerPrevious: string, pagerRightArrow: string, sortAscending: string, sortDescending: string, sortUnset: string, treeStatusCollapsed: string, treeStatusExpanded: string, treeStatusLoading: string }, defaultColumnWidth: number, footerHeight: number, headerHeight: NonNullable<(number | "auto" | undefined)>, messages: { ariaFirstPageMessage: string, ariaGroupHeaderCheckboxMessage: string, ariaHeaderCheckboxMessage: string, ariaLastPageMessage: string, ariaLoadingMessage: string, ariaNextPageMessage: string, ariaPageNMessage: string, ariaPreviousPageMessage: string, ariaRowCheckboxMessage: string, emptyMessage: string, selectedMessage: string, totalMessage: string }, rowHeight: NonNullable<(number | "auto" | (row: any) => number | undefined)> }>
Computed signal that returns the corrected offset value. It ensures the offset is within valid bounds based on rowCount and pageSize.
correctedOffset: Signal<number>
The total count of all rows. Default value: 0
count: InputSignalWithTransform<number, unknown>
CSS class overrides for sort and pager icons.
cssClasses: InputSignal<Partial<NgxDatatableCssClasses>>
datatableConfiguration: DatatableConfiguration
A function you can use to check whether you want to disable a row. Example:

(row) =​> { return row.name !== 'Ethel Price'; }

disableRowCheck: InputSignal<((row: TRow) => boolean | undefined)>
A function you can use to check whether you want to show the checkbox for a particular row based on a criteria. Example:

(row, column, value) =​> { return row.name !== 'Ethel Price'; }

displayCheck: InputSignal<((row: TRow, column: TableColumn, value: any) => boolean | undefined)>
element: HTMLElement
A flag to controll behavior of sort states. By default sort on column toggles between ascending and descending without getting removed. Set true to clear sorting of column after performing ascending and descending sort on that column.
enableClearingSortState: InputSignalWithTransform<boolean, unknown>
If the table should use external paging otherwise its assumed that all data is preloaded.
externalPaging: InputSignalWithTransform<boolean, unknown>
If the table should use external sorting or the built-in basic sorting.
externalSorting: InputSignalWithTransform<boolean, unknown>
The minimum footer height in pixels. Pass falsey for no footer
footerHeight: InputSignalWithTransform<number, unknown>
Show ghost loaders on each cell. Default value: false
ghostLoadingIndicator: InputSignalWithTransform<boolean, unknown>
globalConfiguration: any
This attribute allows the user to set a grouped array in the following format:
[
{groupid=1} [
{id=1 name="test1"},
{id=2 name="test2"},
{id=3 name="test3"}
]},
{groupid=2​>[
{id=4 name="test4"},
{id=5 name="test5"},
{id=6 name="test6"}
]}
]

groupedRows: InputSignal<(Group<TRow>[] | undefined)>
A boolean you can use to set the detault behaviour of rows and groups whether they will start expanded or not. If ommited the default is NOT expanded.
groupExpansionDefault: InputSignalWithTransform<boolean, unknown>
Group Header templates gathered from the ContentChild
groupHeader?: DatatableGroupHeaderDirective<any>
This attribute allows the user to set the name of the column to group the data with
groupRowsBy: InputSignal<(keyof TRow | undefined)>
The minimum header height in pixels. Pass a falsey for no header
headerHeight: InputSignal<(number | "auto")>
heightResizeDebounce?: any
The page size to be shown. Default value: undefined
limit: InputSignalWithTransform<(number | undefined), unknown>
Show the linear loading bar. Default value: false
loadingIndicator: InputSignalWithTransform<boolean, unknown>
Message overrides for localization
messages: InputSignal<Partial<NgxDatatableMessages>> = { emptyMessage: 'No data to display', totalMessage: 'total', selectedMessage: 'selected', ariaFirstPageMessage: 'go to first page', ariaPreviousPageMessage: 'go to previous page', ariaPageNMessage: 'page', ariaNextPageMessage: 'go to next page', ariaLastPageMessage: 'go to last page', ariaRowCheckboxMessage: 'Select row', ariaHeaderCheckboxMessage: 'Select all rows', ariaGroupHeaderCheckboxMessage: 'Select row group', ariaLoadingMessage: 'Loading' }
The current offset ( page - 1 ) shown. Default value: 0
offset: ModelSignal<number>
The table was paged either triggered by the pager or the body scroll.
page: OutputEmitterRef<PageEvent>
pageSize: Signal<number>
Columns were re-ordered.
reorder: OutputEmitterRef<ReorderEvent>
Enable/Disable ability to re-order columns by dragging them.
reorderable: InputSignalWithTransform<boolean, unknown>
Column was resized.
resize: OutputEmitterRef<ColumnResizeEvent>
Re-measures the table width and body viewport height whenever either changes.
resizeObserver?: any
A function which is called with the row and should return either: - a string: "class-1 class-2 - a Record: { 'class-1': true, 'class-2': false }
rowClass: InputSignal<((row: TRow) => (string | Record<string, boolean>) | undefined)>
rowCount: Signal<number>
Row Detail templates gathered from the ContentChild
rowDetail?: DatatableRowDetailDirective<any>
rowDiffer: IterableDiffer<(TRow | undefined)>
Emits HTML5 native drag events. Only emits dragenter, dragover, drop events by default. Set rowDraggable to true for dragstart and dragend.
rowDragEvents: OutputEmitterRef<DragEventData>
A flag to enable drag behavior of native HTML5 drag and drop API on rows. If set to true, rowDragEvents will emit dragstart and dragend events.
rowDraggable: InputSignalWithTransform<boolean, unknown>
Height of each row. When virtual scrolling is disabled, use 'auto' for fluid heights. With virtual scrolling enabled, provide a number or a function that calculates each row's height.
rowHeight: InputSignal<(number | "auto" | (row: TRow) => number)>
This will be used when displaying or selecting rows. when tracking/comparing them, we'll use the value of this fn,

( fn(x) === fn(y) instead of x === y )

rowIdentity: InputSignal<(x: RowOrGroup<TRow>) => unknown>
Rows that are displayed in the table.
rows: InputSignal<((TRow | undefined)[] | null | undefined)>
Body was scrolled typically in a scrollbarV:true scenario.
scroll: OutputEmitterRef<ScrollEvent>
Enable horz scrollbars
scrollbarH: InputSignalWithTransform<boolean, unknown>
scrollbarHelper: any
Enable vertical scrollbars
scrollbarV: InputSignalWithTransform<boolean, unknown>
Enable vertical scrollbars dynamically on demand. Property scrollbarV needs to be set true too. Width that is gained when no scrollbar is needed is added to the inner table width.
scrollbarVDynamic: InputSignalWithTransform<boolean, unknown>
scrollToRowTree: any
Property to which you can use for determining select all rows on current page or not.
selectAllRowsOnPage: InputSignalWithTransform<boolean, unknown>
A boolean/function you can use to check whether you want to select a particular row based on a criteria. Example:

(selection) =​> { return selection !== 'Ethel Price'; }

selectCheck: InputSignal<((value: TRow, index: number, array: TRow[]) => boolean | undefined)>
List of row objects that should be represented as selected in the grid. Default value: []
selected: ModelSignal<TRow[]>
Type of row selection. Options are:

- single - multi - checkbox - multiClick - cell

For no selection pass a falsey . Default value: undefined

selectionType: InputSignal<(SelectionType | undefined)>
Array of sorted columns by property and type. Default value: []
sorts: ModelSignal<SortPropDir[]>
Sorting mode. In single mode, sorting a new column replaces existing sorts; in multi mode, it adds an additional column sort.
sortType: InputSignal<SortType>
A height of summary row
summaryHeight: InputSignalWithTransform<number, unknown>
A property holds a summary row position: top/bottom
summaryPosition: InputSignal<string>
A flag for switching summary row on / off
summaryRow: InputSignalWithTransform<boolean, unknown>
Custom summary row template gathered from the ContentChild
summaryRowDirective: Signal<(DatatableSummaryRowDirective | undefined)>
Swap columns on re-order columns or move them.
swapColumns: InputSignalWithTransform<boolean, unknown>
The context menu was invoked on the table. type indicates whether the header or the body was clicked. content contains either the column or the row that was clicked.
tableContextmenu: OutputEmitterRef<ContextMenuEvent<TRow>>
tableWidth: WritableSignal<number>
Template for the target marker of drag target columns.
targetMarkerTemplate: InputSignal<(TemplateRef<unknown> | undefined)>
totalColumnGroupWidths: Signal<number>
Property to which you can use for custom tracking of rows. Example: 'name'
trackByProp: InputSignal<(keyof TRow | undefined)>
A row was expanded ot collapsed for tree
treeAction: OutputEmitterRef<{ row: TRow, rowIndex: number }>
Tree from relation
treeFromRelation: InputSignal<(string | undefined)>
Tree to relation
treeToRelation: InputSignal<(string | undefined)>
verticalScrollVisible: boolean
viewportRowCount: any
A flag for row virtualization on / off
virtualization: InputSignalWithTransform<boolean, unknown>
Pending debounce timers for the resizeObserver callback.
widthResizeDebounce?: any
Methods
Recalculates the sizes of the page
calcPageSize: () => number
Calculates the row count.
calcRowCount: () => number
(originalArray: (TRow | undefined)[], groupBy: keyof TRow) => { key: TRow[ keyof TRow], value: TRow[] }[]
Creates a map with the data grouped by the user choice of grouping index
Parameters
the original array passed via parameter
originalArray: (TRow | undefined)[]
the key of the column to group the data by
groupBy: keyof TRow
Lifecycle hook that is called after a component's view has been fully initialized.
ngAfterViewInit: () => void from AfterViewInit.ngAfterViewInit
A callback method that performs change-detection, invoked after the default change-detector has checked the directive's input bindings in the parent template. See KeyValueDiffers and IterableDiffers for implementing custom change checking for collections.
ngDoCheck: () => void from DoCheck.ngDoCheck
A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.
ngOnDestroy: () => void from OnDestroy.ngOnDestroy
(offset: number) => void
Body triggered a page event.
Parameters
offset: number
The body triggered a scroll event.
Parameters
event: ScrollEvent
The header triggered a contextmenu event.
Parameters
Parameter: { column: TableColumnInternal, event: MouseEvent }
The header triggered a column re-order event.
Parameters
event: ReorderEventInternal
The header triggered a column resize event.
Parameters
Parameter: ColumnResizeEventInternal
Parameters
Parameter: ColumnResizeEventInternal
The header triggered a column sort event.
Parameters
event: SortEvent
The footer triggered a page event.
Parameters
event: PagerPageEvent
Toggle all row selection
onHeaderSelect: () => void
({ event: MouseEvent, row: RowOrGroup<TRow> }) => void
The body triggered a contextmenu event.
Parameters
Parameter: { event: MouseEvent, row: RowOrGroup<TRow> }
(event: { row: TRow }) => void
A row was expanded or collapsed for tree
Parameters
event: { row: TRow }
Deprecated: No-op. The window:resize listener was replaced by a ResizeObserver ; this will be removed in a future release.
onWindowResize: () => void
Deprecated: No-op. Dimensions are kept current by a ResizeObserver on the host element; this will be removed in a future release.
recalculate: () => void
(forceIdx: number, allowBleed: boolean) => TableColumnInternal<any>[]
Recalulcates the column widths based on column width distribution mode and scrollbar offsets.
Parameters
forceIdx?: number
allowBleed?: boolean
Deprecated: No-op. Dimensions are kept current by a ResizeObserver on the host element; this will be removed in a future release.
recalculateDims: () => void
(row: TRow, options: ScrollToRowOptions) => void
Parameters
row: TRow
options?: ScrollToRowOptions

Except where otherwise noted, content on this site is licensed under MIT License.