access a model property from a field convert function
i add a property to a model with default value 50 before it is instantiated like shown below.
Code:
var propertyValue = 50;
this.myStore.getModel().addStatics({
modelProperty: propertyValue,
});
this.myStore.load();
i then want to access this property from a field convert function like below, however, this returns 'undefined' in the log. also when i hard code the property in the model, i am not able to access its value. Is there a way to do this? many thanks in advance for any suggestions
//i omitted the rest of the snippet for the ease of reading
Code:
fields: [
{name: 'id'},
{name: 'distance',
convert: function (value, record) {
console.log(this.modelProperty)
},
},
],