Could someone explain how I can implement the Individual column searching feature for a datatable in an Angular 5 application?
I'm stuck on this issue. Any help would be greatly appreciated.
Here is my TypeScript file:
dtOptions: DaaTables.Settings = {};
ngOnInit() { console.log(this.items) this.dtOptions = { pagingType: 'full_numbers', pageLength: 5, ordering:true, orderCellsTop:true, }; this.service.getUsers().subscribe(users=>{ this.users=users; this.dtTrigger.next(); console.log(this.users) }); }
And this is my HTML file
<table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="row-border hover">
<thead>
<tr>
<th><input type="text" class="form-control"
placeholder="ID" /></th>
<th><input type="text" class="form-control"
placeholder="name" /></th>
<th><input type="text" class="form-control"
placeholder="username" /></th>
</tr>
<tr>
<th>ID</th>
<th>name</th>
<th>username</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let user of users">
<td>{{ user.id }}</td>
<td>{{ user.name }}</td>
<td>{{ user.username }}</td>
</tr>
</tbody>
</table>