Currently, I am utilizing p-dataView and I'm interested in implementing p-fieldset based on the application type. My goal is to prevent the fieldset from being duplicated when multiple instances occur. The scenario below illustrates one such case; however, there will be multiple occurrences of fieldsSet. I am uncertain about the most effective method to achieve this. Essentially, I want to group specific rows under a single fieldset.
For example:
<p-dataView [value]="someobject" [paginator]="true" [rows]="20">
<ng-template let-prev let-rowIndexValue="rowIndex" pTemplate="listItem">
<div class="container">
<div class="row">
<p-fieldset class="fieldset-auto-width" *ngIf="prev.app_type == 10">
<p-header style="width:30px">Apps</p-header>
<div class="col-md-3">
<input type="checkbox" id="cbPreviewID" checked name="cbxPreview" (click)="togglePreviewApp($event,rowIndexValue)" style="margin-right:5px;margin-bottom:10px;margin-left:5px; margin-top:10px" [value]='prev.app_id'> {{prev.app_name}}
</div>
<div *ngIf="prev.roles.length>1" class="col-md-3" style="margin-right:5px;margin-bottom:10px;margin-left:5px; margin-top:10px">
<b>Role:</b>
<select name="role" (ngModelChange)="selectedPreviewAppRole($event,rowIndexValue)" class="dropdown" style="width:85%" required [(ngModel)]="prev.seletedAppRoleID">
<option class="dropdown-item" value="" selected>Select</option>
<option class="dropdown-item" *ngFor='let role of prev.roles' [ngValue]="role.app_role_id">
{{role.app_role_name}}
</option>
</select>
</p-fieldset>
</div>
</div>
</ng-template>
</p-dataView>
The goal is to have test 1 & 2 grouped under a single field set because their (prev.app_type == 10).
Current Output: https://i.stack.imgur.com/nZiiq.jpg
Desired Outcome: https://i.stack.imgur.com/cqStN.jpg