答案 0 :(得分:1)
类似以下的方法将起作用:
TableListWidget.children._values
.map(function(obj){
return parseInt(obj.descendants.nameOfYourKMField.value);
})
.reduce(function(accumulator, currentValue){
return accumulator + currentValue;
});
TableListWidget.children._vaues
包含所有表行的数组,每行的descendants
属性将包含具有KM值的小部件。我们将_values
数组映射到KM字段值的数组,然后使用reduce
函数将其添加。