View Full Version : Convert function in model called multiple times for a single record load.

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?


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"},

17 May 2012, 7:40 PM
I found the cause and it is in my code. The convert function is now working as expected.