View Full Version : Ext.data.Model hasMany association single base type but multiple concrate types...

2 Jan 2012, 7:30 AM
I have a Model class with a hasMany association:

Ext.define('SampleModel', {
extend: 'Ext.data.Model',
fields: [
associations: [
{ type: 'hasMany', name: 'shapes', associationKey: 'shapes', model: 'ShapeModel' }

The hasMany association's model is 'ShapeModel', but the concrate types of 'shapes' are: CircleModel, BoxModel, ect... (they are inherited from ShapeModel)

When I download a SampleModel from the server the default reader wont create CircleModel, BoxModel, but simple 'ShapeModels' in shapesStore of the SampleModel.

How can I do a polimorp deserialization on the client? What method of the reader should I override?