since you have removed your 'each' function,now you can:
Code:
//make sure your store has loaded the data. eg: store.load,store.setData
store.each(function(record,id){
console.info(record);
});
var sumValue=store.sum('yourRecordFieldName');
console.info(sumValue);
if you want your store doeach with some default function
Code:
Ext.define('MyStore',{
each:function(){
if(arguments.length==0){
this.callParent([this.doEach,this]);
}else{
this.callParent(arguments);
}
},
doEach:function(record,id){
console.info(record);
}
})
myStoreInstance.each();//call default doEach
myStoreInstance.each(function(record,id){},scope);//call new function