Angular Datatable >> 如何获取总行数和所有金额值的总和。需要获取表的总行数。我尝试使用下表并仅获取第一页记录。请建议我如何获取get total number of records across all page以及需要获取sum of the total records values. 我尝试使用下面的代码,getTotalAmount(){ let amountValues=""; let rowCount = $("table > tbody").children().length; console.log("rowCount ::: " + rowCount); for(var i=0;i<rowCount;i++){ if(this.persons[i].firstName === 'Superman' && this.persons[i].index != '') console.log(this.persons[i].index); amountValues += parseFloat(this.persons[i].enteredDebit); } console.log("amountValues >>>>>>>" + amountValues); }工作堆栈闪电战
1 回答

DIEA
TA贡献1820条经验 获得超2个赞
请查找更新后的代码。您必须使用 person[i].id 而不是索引。
https://stackblitz.com/edit/angular-datatables-gitter-zbcrwx?file=app/app.component.ts
添加回答
举报
0/150
提交
取消