diff --git a/projects/ngx-datatable/src/lib/components/body/body-row-wrapper.component.ts b/projects/ngx-datatable/src/lib/components/body/body-row-wrapper.component.ts index 7588d40d9..1c897ae4e 100644 --- a/projects/ngx-datatable/src/lib/components/body/body-row-wrapper.component.ts +++ b/projects/ngx-datatable/src/lib/components/body/body-row-wrapper.component.ts @@ -110,13 +110,14 @@ export class DataTableRowWrapperComponent implements DoCheck, OnInit { } ngDoCheck(): void { + if (this.disableCheck) { + const isRowDisabled = this.disableCheck(this.row); + this.disable$.next(isRowDisabled); + this.cd.markForCheck(); + } if (this.rowDiffer.diff(this.row)) { this.rowContext.row = this.row; this.groupContext.group = this.row; - if (this.disableCheck) { - const isRowDisabled = this.disableCheck(this.row); - this.disable$.next(isRowDisabled); - } this.cd.markForCheck(); } } diff --git a/projects/ngx-datatable/src/lib/components/datatable.component.ts b/projects/ngx-datatable/src/lib/components/datatable.component.ts index c6b71077b..ab619dc05 100644 --- a/projects/ngx-datatable/src/lib/components/datatable.component.ts +++ b/projects/ngx-datatable/src/lib/components/datatable.component.ts @@ -829,7 +829,7 @@ export class DatatableComponent implements OnInit, DoCheck, AfterViewInit, After * Lifecycle hook that is called when Angular dirty checks a directive. */ ngDoCheck(): void { - if (this.rowDiffer.diff(this.rows)) { + if (this.rowDiffer.diff(this.rows) || this.disableRowCheck) { if (!this.externalSorting) { this.sortInternalRows(); } else {