Open eXpertise7 opened 1 year ago
Error message:
error_handler.ts:45 ERROR TypeError: Cannot read properties of null (reading 'length') at UsersListComponent_ng_template_12_Template (users-list.component.html:88:35) at ReactiveLViewConsumer.runInContext (reactive_lview_consumer.ts:48:7) at executeTemplate (shared.ts:266:16) at refreshView (change_detection.ts:140:7) at detectChangesInView (change_detection.ts:320:5) at detectChangesInEmbeddedViews (change_detection.ts:258:7) at refreshView (change_detection.ts:167:5) at detectChangesInView (change_detection.ts:320:5) at detectChangesInEmbeddedViews (change_detection.ts:258:7) at refreshView (change_detection.ts:167:5)
Line 88 in the template is:
<tr [pContextMenuRow]="user" [@tableListAnimation]="columns.length" [pSelectableRow]="user">
This has always worked, the issue is somewhere here.
Are you using a multiselect to control the default visible columns? They aren't pre-selecting options #13999
Hi,
Could you please share a stackblitz example so we can identify the issue?
Are you using a multiselect to control the default visible columns? They aren't pre-selecting options #13999
We do. Our column data are connected/bound through p-multiSelect
and p-table
components.
I found I could reliably cause this bug by using 'resizableColumns' attribute set to 'true'
If I omit that attribute or set it to 'false' no error. If I set it to 'true' I get the multiple errors similar to the OP
@DonnOMalley well, for years everything has worked fine with resizableColumns
set to true
, so obviously bug is introduced somewhere with the p-multiselect
and p-table
bound data.
Describe the bug
At PrimeNG 16.7.0 version, dynamic columns at
p-table
do not appear, andlength
issue at browser console appears.On PrimeNG 16.6.0 version and versions below, issue does not appear.
I can create stackblitz example, if needed, but this is real bug that's introduced in primeng migration from v16.6.0 to v16.7.0. Developers who have dynamic columns at tables are going to notice this immediately, because everything will break.
@cetincakiroglu please take a look at this. Thanks.
Environment
Angular v16.2.3, PrimeNG v16.7.0.
Reproducer
No response
Angular version
16.2.3
PrimeNG version
16.7.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.20.2
Browser(s)
Google Chrome, version 118.0.5993.118
Steps to reproduce the behavior
Expected behavior
Dynamic columns at tables should appear normally, and browser error shouldn't be existing.