i have defined my model with a REST proxy. it works fine for read (GET) and update (PUT) because those operations require a primary id. when i perform a create operation (POST) the proxy sends all the fields, including the empty primary id, to the server, which causes and error on the server. the server expects that no primary id is to be included for a create operation. how do i instruct extjs to not send the empty primary id value? ie. "{ 'model_id':'',...}"?
Ext.define('model', {
extend : 'Ext.data.Model',
idProperty : 'model_id',
fields : ['model_id', 'first', 'last'],
proxy : {
type : 'rest'
}
});
var mymodel = Ext.create('model',{last:'digler'});
mymodel.save() //posts "{ 'model_id':'', 'last':'digler'}"?
i want it to not include the primary id field at all on a create.