bweiler
16 May 2012, 7:31 PM
I have a model that looks like the following and when I call store.load to get a single record from the server, the convert function is called 42 times. I looked at the store and there is only one record in the store that contains the model fields and two arrays for User and Account.
I also tried calling the function from the XTemplate and it was only called once when the store was loaded and the model was displayed in my view.
Is there any reason the convert function on a single field is called so many times when a single record is loaded?
Thanks
Ext.define('MyApp.model.MyData', {
extend: 'Ext.data.Model',
config: {
fields: [
{name: "website", type: "string",
convert: function(url) {
console.log("convert function", url);
return decodeURIComponent(url);
}},
],
hasMany: [
{model: "User", name: "user"},
{model: "Account", name: "acct"},
]
}
});
I also tried calling the function from the XTemplate and it was only called once when the store was loaded and the model was displayed in my view.
Is there any reason the convert function on a single field is called so many times when a single record is loaded?
Thanks
Ext.define('MyApp.model.MyData', {
extend: 'Ext.data.Model',
config: {
fields: [
{name: "website", type: "string",
convert: function(url) {
console.log("convert function", url);
return decodeURIComponent(url);
}},
],
hasMany: [
{model: "User", name: "user"},
{model: "Account", name: "acct"},
]
}
});