angularprimengprimeng-turbotableprimeng-table

Primeng table very slow with virtual scroll and expanded rows


The table loads super and editing is also slow to start when rowexpansion is added for large data 2000 rows by 64 columns and 10000 rows by 5 columns. It looks like lazy load is not implemented on it. I was thinking of just loading expanded rows only when the button is clicked. I tried to bind with *ngIf and the expand button click but it didn't expand. Even conditionally disabling using *ngIf for tables with no related record didn't work. Is there any way of making it lazy load?

I have live example in stackblitz.


Solution

  • It seems like this is a bug on primeng but I found a good workaround. Mainly, the solution involves removal of rowexpansion completely and replacing it by <tr> that will contain a div or another component that appears conditionally when the Expand button is clicked.

    See the updated stackbitiz with no lag.