【发布时间】:2018-12-18 04:08:56
【问题描述】:
我正在使用过滤条件过滤表中的行。
<tr *ngFor="let result of mf.data | filter:filter; let i = index">
我们使用 ng2-search-filter
目前,它的过滤基于关键字,但我想在输入逗号分隔格式的关键字时过滤行。
如何更改上面的行以使其正常工作?
全桌
<table id="groups" class="table table-bordered table-hover dataTable" [mfData]="resultData" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
[(mfSortBy)]="sortBy" [(mfSortOrder)]="sortOrder">
<thead>
<tr role="row">
<th> <mfDefaultSorter by="HostName">Host Name</mfDefaultSorter></th>
<!-- <th><mfDefaultSorter by="SupportDL">Support DL</mfDefaultSorter></th> -->
<th><mfDefaultSorter by="Connectivity">Connectivity</mfDefaultSorter></th>
<th><mfDefaultSorter by="RDPStatus">RDP Status</mfDefaultSorter></th>
<th><mfDefaultSorter by="MemoryStatus">Memory Status</mfDefaultSorter></th>
<th><mfDefaultSorter by="CPUStatus">CPU Status</mfDefaultSorter></th>
<th><mfDefaultSorter by="ServiceStatus">Service Status</mfDefaultSorter></th>
<th><mfDefaultSorter by="ServiceLogStatus">Service Log Status</mfDefaultSorter></th>
<th><mfDefaultSorter by="DiskStatus">Disk Status</mfDefaultSorter></th>
<th><mfDefaultSorter by="LogTime">Log Time</mfDefaultSorter></th>
<!-- <th>Actions</th> -->
</tr>
</thead>
<tbody *ngIf="resultData.length>0">
<tr *ngFor="let result of mf.data | filter:filter; let i = index">
<td>{{result.HostName}}</td>
<!-- <td>{{result.SupportDL}}</td> -->
<td>{{result.Connectivity}}</td>
<td>{{result.RDPStatus}}</td>
<td>{{result.MemoryStatus}}</td>
<td>{{result.CPUStatus}}</td>
<td><pre>{{result.ServiceStatus}}</pre></td>
<td>{{result.ServiceLogStatus}}</td>
<td><pre>{{result.DiskStatus}}</pre></td>
<td>{{result.LogTime}}</td>
</tr>
</tbody>
<tr *ngIf="resultData.length <=0"><td colspan="10"> No Data Found</td></tr>
<tfoot>
<tr>
<td colspan="8">
<mfBootstrapPaginator></mfBootstrapPaginator>
</td>
</tr>
</tfoot>
</table>
【问题讨论】:
标签: angular pipe angular2-directives