Accessing data in p-table question

UI Components for Angular
Post Reply
vimbsoft
Posts: 5
Joined: 04 Jun 2022, 23:03

18 Jul 2023, 11:17

Hi all,

I have maybe a stupid question.

I use different approaches to create my tables with prime ng. Now I am wondering about the following.

In one of my tables I'm using the dynamic column creation feature.

In my component I add the field names and one field is

Code: Select all

'object2.name'
Now in the html if I use

Code: Select all

{{object1[col.field]}}
It will add the value from the field

Code: Select all

'object2.name'
but won't display it. I know the value is there because if I filter this column it shows the correct rows.

Now if I change my html to

Code: Select all

{{object1[col.field].name}}
and remove the

Code: Select all

'name'
from

Code: Select all

'object2'
it will also display the value in the table, but clearly every other column won't match.

And at least if I use the standard approach

Code: Select all

{{object1.object2.name}}
it will also display the value correctly

Is this intentional or a bug? Can someone explain it to me?

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests