Hybrid 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
-
16 Mar 2012 3:47 AM #2
Just opened my eyes ... a simple "Basic Function" drag and drop to the model does the trick.
Sorry for the noise.
-
16 Mar 2012 6:33 AM #3
You should be able to use convert function available on a field.
Bharat Nagwani
Sencha Designer Development Team


Reply With Quote