我的博客结构如下:
<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>
现在为此,我有一个带有 hasManyAssociation 的 extjs 模型。上部模型工作正常,除了画廊项目。我的模型如下所示:
父模型:
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'
}
}
});
子模型:
Ext.define('App.model.Gallery', {
extend: 'Ext.data.Model',
config: {
fields: [{
name: 'image'
}, {
mapping: '@folder',
name: 'folder'
}]
}
});
有人知道我做错了什么吗?