我在我的应用程序中使用 jhipster。我有一个表,我添加了分页和排序,但我还想在列中添加搜索字段,这可能吗?会是这样的http://ng-table.com/ http://ng-table.com/
我的 HTML 是:
<div class="table-responsive" *ngIf="entities">
<table class="table table-striped">
<thead>
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="transition.bind(this)">
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <span class="fa fa-sort"></span></th>
<th jhiSortBy="nombre"><span jhiTranslate="app.entity.name">Name</span> <span class="fa fa-sort"></span></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let entity of entities ;trackBy: trackId">
<td><a [routerLink]="['../entity', entity.id ]">{{entity.id}}</a></td>
<td>{{entity.name}}</td>
</tr>
</tbody>
</table>
</div>
谢谢。
我设法使用输入和角度的“purefilter”属性来做到这一点。事情是这样的:
<input type="text" [(ngModel)]="filter" class="form-control">
<table>
......
<tr *ngFor="let entity of (entities | pureFilter:filter:'name')>
.......
在 pureFilter 中,我们指示 'pureFilter:nameOfFilter:attributeOfEntity'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)