PDA

View Full Version : Association



Jad
21 Aug 2012, 6:03 AM
Hello,

Is it necessary to put a belongsTo association if in the auther data model the hasMany is seted

romanyu
5 Nov 2012, 5:48 PM
In my condition, the answer is Yes. Here is my code:


Ext.define('MyProject.model.MyProjectModel', {
extend: 'Ext.data.Model',

config: {
fields: ['name', 'desc'],
hasMany: {
model: "MyProject.model.MyProjectDetailModel",
name: 'detail',
associationKey: 'detail'
}
}

});



Ext.define('MyProject.model.MyProjectDetailModel', {
extend: 'Ext.data.Model',

config: {
fields: ['logo', 'phone', 'working hours']
}
});