PDA

View Full Version : [FIXED]Using the proxy of the parent in stead of the object



bert.hajee
19 Feb 2011, 12:26 PM
L.S.

When using the extent on a regMode, the proxy of the parent is used in stead of the proxy of the object.

Example:



Ext.regModel('superclass', {
fields: [
{name: 'id', type: 'int'},
],

proxy: {
url: '/undefined'
,type: 'rest'
}
}
Ext.regModel('testclass', {
extend: 'superclass',
fields: [
{name: 'name', type: 'string'},
{name: 'description', type: 'string'},
],


proxy: {
,url: '/super'
},



When using class testclass, the proxy of superclass is used.

Checking out the code of ModelMgr at line 99 I see this:


if (extendName) {
extendModel = this.types[extendName];
extendModelProto = extendModel.prototype;
extendValidations = extendModelProto.validations;

proxy = extendModel.proxy;
fields = extendModelProto.fields.items.concat(fields);
associations = extendModelProto.associations.items.concat(associations);
config.validations = extendValidations ? extendValidations.concat(config.validations) : config.validations;
} else {
extendModel = Ext.data.Model;
proxy = config.proxy;
}


Shouldn't this be:



if (extendName) {
extendModel = this.types[extendName];
extendModelProto = extendModel.prototype;
extendValidations = extendModelProto.validations;

proxy = extendModel.proxy;
fields = extendModelProto.fields.items.concat(fields);
associations = extendModelProto.associations.items.concat(associations);
config.validations = extendValidations ? extendValidations.concat(config.validations) : config.validations;
} else {
extendModel = Ext.data.Model;
}
if (config.proxy) {
proxy = config.proxy;
}


Regards,

Bert Hajee