我有一个团队列表,其中有3个字段需要显示:
1-团队名称2-团队经理3-支持人员(此字段显示多个数据)
我在此表上有一个全局过滤器,但是我的问题是搜索不适用于“ Support Worker”列。知道为什么吗?
这是我的代码:
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-6">
<div class="ui-inputgroup">
<span class="ui-inputgroup-addon"><i class="material-icons">search</i></span>
<span class="md-inputfield">
<input #gbTeam type="text" pInputText style="padding: 6px 3px;font-size: 16px;">
<label>Search</label>
</span>
</div>
</div>
<div class="ui-g-12 ui-md-6" style="text-align:right">
<button label="Add New Team" icon="ui-icon-add" class="ui-button-success" pButton (click)="onAdd($event)">
</button>
</div>
<div class="ui-g-12 ui-md-12">
<p-dataTable selectionMode="single" [value]="teamsList" [globalFilter]="gbTeam" [(selection)]="selectedTeam"
[responsive]="true" (onRowDblclick)="onRowDoubleClicked($event)">
<p-column field="Name" header="Team Name"></p-column>
<p-column field="Manager.DisplayName" header="Team Manager"></p-column>
<p-column styleClass="col-button" header="Support Workers">
<ng-template let-row="rowData" let-i="rowIndex" pTemplate="body">
<div *ngFor="let TeamSupportWorker of row.TeamSupportWorkers">
{{TeamSupportWorker.DisplayName}}
</div>
<br />
</ng-template>
</p-column>
<p-column styleClass="col-button">
<ng-template let-row="rowData" let-i="rowIndex" pTemplate="body">
<div class="btn-group" role="group" aria-label="First group">
<button title="Edit" type="button" icon="ui-icon-edit" pButton (click)="onEdit(row)">
</button>
<button title="Delete" type="button" icon="ui-icon-delete" class="ui-button-danger" pButton (click)="onRemove(row)">
</button>
</div>
</ng-template>
</p-column>
</p-dataTable>
</div>
</div>