diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index a4114524906..7f0a66a091b 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -3926,7 +3926,7 @@ export class ReorderableColumn implements AfterViewInit, OnDestroy { class: 'p-element' } }) -export class EditableColumn implements AfterViewInit, OnDestroy { +export class EditableColumn implements OnChanges, AfterViewInit, OnDestroy { @Input('pEditableColumn') data: any; @Input('pEditableColumnField') field: any; @@ -3941,6 +3941,12 @@ export class EditableColumn implements AfterViewInit, OnDestroy { constructor(public dt: Table, public el: ElementRef, public zone: NgZone) {} + public ngOnChanges({ data }: SimpleChanges): void { + if (this.el.nativeElement && !data.firstChange) { + this.dt.updateEditingCell(this.el.nativeElement, this.data, this.field, this.rowIndex); + } + } + ngAfterViewInit() { if (this.isEnabled()) { DomHandler.addClass(this.el.nativeElement, 'p-editable-column');