akveo / akveo/ngx-admin

Error - search customized on smart-table

未關閉
#5,943 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
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 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。