I have the following structure for a blog:
<channel>
<item>
<title>title of post</title>
(...)
<gallery folder="path_to_gallery">
<image>path_to_image</image>
<image>path_to_other_image</image>
</gallery>
<gallery folder="path_to_other_gallery">
<image>path_to_new_image</image>
<image>path_to_other_new_image</image>
</gallery>
</item>
</channel>
Now for this, I have an extjs model with a hasManyAssociation. The upper model works fine, apart from the gallery items. My models look like this:
Parent model:
Ext.define('App.model.News', {
extend: 'Ext.data.Model',
config: {
fields: [{
name: 'title'
}, {
name: 'description'
}, {
name: 'thumbnail'
}, {
name: 'pubDate',
type: 'date'
}],
hasMany: {
associationKey: 'gallery',
primaryKey: 'folder',
model: 'App.model.Gallery'
}
}
});
child model:
Ext.define('App.model.Gallery', {
extend: 'Ext.data.Model',
config: {
fields: [{
name: 'image'
}, {
mapping: '@folder',
name: 'folder'
}]
}
});
Anyone have a clue what I'm doing wrong?