Hey all,
I'm taking a store, grouping it, doing getGroups() on it, and mapping that array onto a new store. Code:
Code:
createStore:function(){
var store = Ext.data.StoreManager.lookup('Store');
store.group('activities');
var groups = store.getGroups();
console.log(groups);
var groupStore = Ext.create('Ext.data.Store', {
model: 'APP.model.Activities',
fields: [{
name:'activities', mapping: 'name'
}, {
name: 'total', convert: function(value, record){
console.log("hey");
return record.raw.children.length;
}
}],
data: groups
});
console.log(groupStore);
return groupStore;
}
This is a method in my chart definition and I'm calling it in the initComponent like so:
Code:
initComponent: function(){
this.store = this.createStore();
this.callParent(arguments);
},
The store that I get out of the function has the right number of entries and fields but the data is all zeroes. I cant see the console output "hey" that I put in the convert function. So somehow store is created but none of the mapping happens, yet the fields are correctly named "total" and "activities". Anyone have any ideas? I've been banging my head on this all day