Error - search customized on smart-table
- 主要语言
- TypeScript
- 星标
- 25.7k
- 派生
- 7.9k
- PR 合并指标
- 30 天内没有已合并 PR
描述
My code following the Documentation:
- https://akveo.github.io/ng2-smart-table/#/examples/using-filters
component.html:
Smart Table
component.ts:
source: LocalDataSource = new LocalDataSource();
constructor(private httpClient: HttpClient) {
this.httpClient.get('/assets/data/Cadastros.json').subscribe((result: Cadastro[]) => {
this.data = result;
this.source.load(this.data);
});
}
filterTable() {
if (this.text === ' ') {
console.log('Hello');
this.source.load(this.data);
} else {
this.source.setFilter([
{
field: 'Id',
search: this.text,
},
], false);
}
}
My problem is there in the "if" of the function "filter()", I can't update again my table when my search is empty.
The documentation is the same, can you help me please.
贡献指南
评估
这个 Issue 还没有评估数据。