PDA

View Full Version : How do I define a getter on a Model?



el_chief
4 Dec 2011, 12:57 PM
I meant to type "How do I define a getter on a Model FIELD?" :)

1. it's not convert(), that's actually setter.

2. it would have to work with BasicForm.loadRecord(), so that I can display the field automatically.

loadRecord seems to read off of the model.data object

thanks

ultra2
4 Dec 2011, 1:58 PM
override the get function of Ext.data.Model, its my idea, but Iam not expert in Extjs!

get: function(field) {
var result = this.callParent(arguments);
//your code
return result;
},

el_chief
4 Dec 2011, 2:12 PM
override the get function of Ext.data.Model, its my idea, but Iam not expert in Extjs!

get: function(field) {
var result = this.callParent(arguments);
//your code
return result;
},

Thanks, but that doesn't work with form.loadRecord()