如何设置页面在过滤后开始?

时间:2020-07-27 07:29:23

标签: ng2-smart-table

在ng2-smart-table中,我使用内置的列过滤器来过滤数据。每当过滤数据时,我总是想将页面设置为first。例如,当数据加载到表中时,我导航到第10页,并使用内置的列过滤器进行搜索。我想从第一页而不是最后一页看到结果。如何实施?请引导我。

1 个答案:

答案 0 :(得分:0)

我是用以下代码完成的:

ResetTable () {
    this.source.reset(true); 
    this.source.setPage(1, false);

    let filterArr = this.getFilterArray(); // customer method to update my filter 
     if (filterArr.length)
       this.source.setFilter(filterArr, false, false); // set the new filter 

    this.source.refresh(); 
}