dr-dan
25 Jul 2012, 6:58 AM
Hi
My record has some child records in one of its associations, however I can see the PUT rest request to save() the parent is not posting the children in the JSON request.
{"Id":53,"Reference":"4554gfg"}
Is there something that I should know about? Are foreign keys mandatory for this to work?
Ext.define('Pegfect.model.Pegfile', {
extend: 'Ext.data.Model',
fields: ['Id', 'Reference'],
idProperty: 'Id',
hasMany: {
model: 'Pegfect.model.Response',
associationKey: 'Responses',
name: 'responses'
},
proxy:
{
type: 'rest',
url: 'Pegfile',
timeout: 120000,
noCache: false,
reader:
{
type: 'json',
root: 'data',
successProperty: 'success'
},
writer:
{
type: 'json',
writeAllFields: true
}
}
});
My record has some child records in one of its associations, however I can see the PUT rest request to save() the parent is not posting the children in the JSON request.
{"Id":53,"Reference":"4554gfg"}
Is there something that I should know about? Are foreign keys mandatory for this to work?
Ext.define('Pegfect.model.Pegfile', {
extend: 'Ext.data.Model',
fields: ['Id', 'Reference'],
idProperty: 'Id',
hasMany: {
model: 'Pegfect.model.Response',
associationKey: 'Responses',
name: 'responses'
},
proxy:
{
type: 'rest',
url: 'Pegfile',
timeout: 120000,
noCache: false,
reader:
{
type: 'json',
root: 'data',
successProperty: 'success'
},
writer:
{
type: 'json',
writeAllFields: true
}
}
});