我想添加空数据行。我的要求就像列是动态的。我尝试使用dtInstance添加行。它抛出了一些错误。
这里是链接
https://stackblitz.com/edit/how-to-replace-all-the-columns-dynamically-in-data-table-gvfose?file=app/app.component.ts
如果需要更多详细信息,请告诉我。
您给数据表提供了错误的模型。您正在代码中混合使用不同的模型。
我已经修复了它,并添加了两个空行,请确保与columnsDataObj定义的模型对齐
columnsDataObj
https://stackblitz.com/edit/how-to-replace-all-the-columns-dynamically-in-data-table-zemuq2?file=app/app.component.ts