Hybrid View

  1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    5
    Vote Rating
    0
    vamadou is on a distinguished road

      0  

    Default 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:

    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(" ");
        }
    });
    Could you help me ?
    Thanks a lot
    Regards

    Vincent

  2. #2
    Sencha User
    Join Date
    Apr 2008
    Posts
    5
    Vote Rating
    0
    vamadou is on a distinguished road

      0  

    Default


    Just opened my eyes ... a simple "Basic Function" drag and drop to the model does the trick.
    Sorry for the noise.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    You should be able to use convert function available on a field.
    Bharat Nagwani
    Sencha Designer Development Team

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar