Directive · v2.7.0
NgbDataGridHistoryDirective
Opt-in history for configuration changes and saved edits to existing rows.
Import
import { NgbDataGridHistoryDirective } from '@angular-bootstrap/ngbootstrap';Selector:ngb-datagrid[ngbGridHistory]
Declaration
Inputs
historyKeyboard
Scoped shortcuts; editable fields retain native text undo.
historyKeyboard: booleanDefault:true
historyLimit
Maximum retained undo steps (1–1000); the current configuration is separate.
set historyLimit(value: number)
get historyLimit(): numberOutputs
historyKeyboardResult
historyKeyboardResult: EventEmitter<NgbDataGridHistoryResult>Properties
busy
readonly busy: i0.Signal<boolean>undoCount
readonly undoCount: i0.Signal<number>redoCount
readonly redoCount: i0.Signal<number>ready
readonly ready: i0.Signal<boolean>error
readonly error: i0.Signal<string>canUndo
readonly canUndo: i0.Signal<boolean>canRedo
readonly canRedo: i0.Signal<boolean>Methods
record
Record application-driven input changes after Angular has applied those inputs.
record(): NgbDataGridHistoryResultclear
Discard both stacks and use the current configuration as a new baseline.
clear(): NgbDataGridHistoryResultundo
undo(): NgbDataGridHistoryResultredo
redo(): NgbDataGridHistoryResultundoAsync
Use these methods when batch editing is enabled; ordinary commands remain synchronous internally.
undoAsync(): Promise<NgbDataGridHistoryResult>redoAsync
redoAsync(): Promise<NgbDataGridHistoryResult>onHistoryKeydown
onHistoryKeydown(event: KeyboardEvent): Promise<void>