I extended an existing Model by adding fields using the prototype. Everything works fine, the data can be received from the server side and can be used on client side. But, when I now update my data and send it back to the server side, the "new" fields are not recognized by the writer of the proxy.
To be more specific: I have a model like this:
Ext.define('Osgaar', {
extend: 'Ext.data.Model',
fields: [
{ name: 'first', type: 'string' },
{ name: 'second', type: 'string' },
{ name' 'third', type: 'string' }
],
proxy: {
type: 'rest',
url: 'public/svcmethod',
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json',
writeAllFields: false
}
}
});
I am extending the model like that:
Osgaar.prototype.fields.add({ name: 'fourth', type: 'string' });
I tried to set writeAllFields to false to get all attributes transferred, there are just those from the defined model, not the one added using the prototype (Fiddler confirms that).
Does anybody now a way to solve this without defining a new model?
Thank you in advance.