Threaded View
-
15 Mar 2012 11:39 PM #1
Add a computed field on a Model
Add a computed field on a Model
Hi,
I have probably overlooked this one but I can't find how to add a "computed" field on a store via the Designer. By computed I mean the 'fullname' field in the example below:
Could you help me ?Code:Ext.define('app.model.User', { extend: 'Ext.data.Model', config: { fields: ['firstName', 'middleName', 'lastName'] }, fullName: function() { var d = this.data, names = [ d.firstName, d.middleName, d.lastName ]; return names.join(" "); } });
Thanks a lot
Regards
Vincent


Reply With Quote