按照例子可以做出来,有个问题就是当我的数量和单价都可以编辑时
if (e.field == "price" || e.field=="amount") {
var total = 0;
for (var i = 0, l = rows.length; i < l; i++) {
var row = rows;
var t = row.price * row.amount;
if (isNaN(t)) continue;
total += t;
}
if (e.field == "price") { //这里写一个就可以了
var total = 0;
for (var i = 0, l = rows.length; i < l; i++) {
var row = rows;
var t = row.price * row.amount;
if (isNaN(t)) continue;
total += t;
}