You can use title function like this for get total of amount fields
const columns = [
{
title: () => {
var total = 0;
for(var i=0;i<data.length;i++){
total += data[i].amount;
}
return <div>total {total}</div>;
} ,
dataIndex: "date",
width: 200
},
{
title: "Amount",
dataIndex: "amount",
width: 100
}
];
Example link here https://codesandbox.io/s/festive-wiles-st6wl?fontsize=14
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.