I want to column filter multiple collection of data using PrimeNG table. The JSON response example below enter image description here.
And so on. On the body of the p-table, I listed the subobject type of each object using *ngFor for each one on the samecolumn:enter image description here As "the desired subject names filter" say above, I want to get filter the property of the mappings "object types" subobjects from each object. Any help is appreciated. HEB Partner
How to get data from multiple subobject using p-columnFilter PrimeNG Table?
-
- Posts: 3
- Joined: 09 Nov 2022, 07:53
To filter the "object types" subobjects from each object in the JSON response using PrimeNG table, you can use the filter property of the p-column component in the p-table component.Shannonmaus wrote: ↑16 Mar 2023, 06:54I want to column filter multiple collection of data using PrimeNG table. The JSON response example below enter image description here.
And so on. On the body of the p-table, I listed the subobject type of each object using *ngFor for each one on the samecolumn:enter image description here As "the desired subject names filter" say above, I want to get filter the property of the mappings "object types" subobjects from each object. Any help is appreciated.
Here is an example of how you can filter the "object types" subobjects from each object:
Code: Select all
<p-table [value]="jsonData">
<ng-container *ngFor="let subObject of jsonData[0].mappings">
<p-column field="mappings" header="Object Types" [filter]="true" filterField="objectType">
{{ subObject.objectType }}
</p-column>
</ng-container>
</p-table>
The [filter]="true" attribute enables filtering for the column, and filterField="objectType" specifies that we want to filter by the objectType property. This means that the user can type in a search term in the filter box, and the table will filter the rows based on whether the objectType property of the subobject matches the search term.
I hope this helps you with your filtering needs! Let me know if you have any further questions. TellTims
-
- Information
-
Who is online
Users browsing this forum: No registered users and 22 guests