【问题标题】:Angular - datatable redraw table with new dataAngular - 带有新数据的数据表重绘表
【发布时间】:2020-07-23 08:43:01
【问题描述】:

我遇到了角度数据表重绘的问题。

https://stackblitz.com/edit/angular-6-angular-way-tutorial-pagination-not-working-13-k1hag7

这是问题的示例。 API调用到这里就完成了。

插件文档 - https://l-lin.github.io/angular-datatables/#/welcome

【问题讨论】:

    标签: javascript angular typescript datatable angular-cli


    【解决方案1】:

    你必须在重新加载数据之前销毁表

    this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
            // Destroy the table first
            dtInstance.destroy();
            // Call the dtTrigger to rerender again
            this.dtTrigger.next();
          });
    

    【讨论】:

      猜你喜欢
      • 2017-01-12
      • 1970-01-01
      • 2016-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多