p-table virtual scroll errors when adding new rows in v9.1

UI Components for Angular
Post Reply
edkennard
Posts: 2
Joined: 25 Jun 2020, 15:54

25 Jun 2020, 16:13

Hi,

I'm using the latest v9.1 components in my project, and have been working on a p-table which is bound to a datasource that is expected to change while the table is displayed in a page. Whenever a new record is added to the datasource and the table updates, I'm seeing errors which look like this:

Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'height: 37910px'. Current value: 'height: 37944px'.

I have put together a sample in StackBlitz, pls view the console to see the errors:
https://stackblitz.com/edit/primeng-tab ... e-primeng9

In this simple sample the rows do actually get added and the state of the table seems to survive, however in my project's larger and more complicated implementation these errors are more disruptive and the table's scrolling breaks.

While putting that sample together, I originally forked some code from a similar sample which was based on PrimeNG version 6, and with all of my own code remaining exactly the same, these errors are *not* happening in PrimeNG 6:
https://stackblitz.com/edit/primeng-tab ... e-primeng6

I'm not sure if this is a PrimeNG issue, or perhaps an Angular issue, since the versions of both changed between these demos.

Does anyone know how I can resolve this?

Many thanks

Ed

edkennard
Posts: 2
Joined: 25 Jun 2020, 15:54

29 Jun 2020, 12:51

Hi all,

I have since confirmed that this issue is definitely a regression between v9.0.6 and v9.1.0, please see sample running v9.0.6 and note the absence of the errors:

https://stackblitz.com/edit/primeng-tab ... primeng9-0

I guess the re-written virtual scrolling functionality released in v9.1.0 is the cause.

Should I formally submit this as an issue in GitHub?

Thanks

Ed

MickeyMiner
Posts: 7
Joined: 04 Jul 2017, 13:05

30 Jun 2020, 18:32

Hi,

this must be a more general error as only adding new records.
After updating to Angular 9.1.11 with PrimeNG 9.1.2 my large (2,600 rows) table with [virtualScroll]="true" also throws the same error (and also with 9.0.6).

Cheers,
mm

thiagonegrao
Posts: 1
Joined: 10 Aug 2020, 16:08

10 Aug 2020, 16:29

Hi all,

Im having the same problem,

Im developping an app where the user will consult and interact with lots of data.
but is impossible to know the full length of the data on the start of the app,
and the user can to add more data thru the interface (e.g: expanding the row or adding new lines).
by using the virtualscroll how it is now if the inicial length of the input array changes,
the CDK-virtualScroll gives me an error (ExpressionChangedAfterItHasBeenCheckedError).

Its possible to implement the p-table with virtual scroll to support adding new elements to the input value array?

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests