如何使用angular2 +在Datatable中添加空数据行?

问题描述 投票:0回答:1

我想添加空数据行。我的要求就像列是动态的。我尝试使用dtInstance添加行。它抛出了一些错误。

这里是链接

https://stackblitz.com/edit/how-to-replace-all-the-columns-dynamically-in-data-table-gvfose?file=app/app.component.ts

如果需要更多详细信息,请告诉我。

javascript angular datatable angular-datatables
1个回答
0
投票

您给数据表提供了错误的模型。您正在代码中混合使用不同的模型。

我已经修复了它,并添加了两个空行,请确保与columnsDataObj定义的模型对齐

https://stackblitz.com/edit/how-to-replace-all-the-columns-dynamically-in-data-table-zemuq2?file=app/app.component.ts

© www.soinside.com 2019 - 2024. All rights reserved.