I am attempting to get virtual scroll working for the TreeTable, and after following the official examples I am getting ExpressionChangedAfterItHasBeenCheckedError
when iI expand any of the nodes for my data.
When trying the official demo's with Stackblitz I see the errors are also generated here too, this is happening for both primeng v9 and v10 latest demo examples.
I noticed a GitHub issue has been raised for this also here - https://github.com/primefaces/primeng/issues/8886 but was closed with a workaround referenced to add a ChangeDetectorRef
and trigger a change detection cycle manually.
I tried this solution with the official stackblitz demo's (https://stackblitz.com/edit/primeng-treetablescroll-demo?file=src%2Fapp%2Fapp.component.ts)
setTimeout(() => {
this.virtualFiles = Array.from({length: 1000}).map((_,i) => this.createNode(i, 100));
this.cd.detectChanges();
}, 2000);
But it makes no difference, the error is still generated, perhaps I am implementing this incorrectly?
To replicate the issue, you just have to expand one of the nodes displayed in the virtual scroll example.
I am particularly interested in a solution\workaround for primeng 9