PDA

View Full Version : Associations are removed when copying model to Tree Store



iamcootis
10 Feb 2014, 11:14 AM
I have a model that has an assocation. The association maintains on the Ext.data.store, but once I make a copy of that model and place it into a Ext.tree.store the associations are gone. Is this by design or a bug?

mitchellsimoens
12 Feb 2014, 8:24 AM
You are running into this: http://www.sencha.com/forum/showthread.php?245005

Personally I use this override instead of the one in that thread for Sencha Fiddle:


Ext.data.Model.override({
copy : function() {
var me = this,
copy = me.callParent(arguments),
reader = copy.getProxy().getReader();

reader.readAssociated(copy, copy.raw);

return copy;
}
});