【发布时间】:2018-09-11 15:28:37
【问题描述】:
正如您将在下面注意到的那样,我正在通过formulas 获取两个不同的商店并获取这些 JSON 的 TOTALCOUNT 整数值。
如何获得这两个不同stores 的总和?
formulas: {
firstStore: {
bind: {
bindTo: '{firstStatStore}',
deep : true
},
get: function (store) {
var record = store.findRecord(MyApp.Names.CODE, MyApp.Names.TOTALSTAT);
return record ? record.get(MyApp.Names.TOTALCOUNT) : "-1";
}
},
secondStore: {
bind: {
bindTo: '{secondStatStore}',
deep : true
},
get: function (store) {
var record = store.findRecord(MyApp.Names.CODE, MyApp.Names.TOTALSTAT);
return record ? record.get(MyApp.Names.TOTALCOUNT) : "-1";
}
},
thirdStore: {
// Here I need "sum of TOTALCOUNT" from firstStore and secondStore.
}
}
【问题讨论】:
标签: javascript json extjs formulas extjs-stores