1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    17
    Vote Rating
    -1
    chaostimmy is an unknown quantity at this point

      0  

    Default using this in xtype definition

    using this in xtype definition


    I can't get "this" to work in an class definition:

    Ext.define('classname', {
    extend: 'Ext.form.Panel',
    layout: 'form',
    labelMap: {
    textfieldLabel: 'write your name here'
    },
    items: [{
    xtype: 'textfield',
    fieldLabel: this.labelMap.textfieldLabel
    }]
    });


    why ?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    Please have a look at the following:

    You need to initialize before you start adding items.

    Code:
    Ext.define('classname', {
        extend: 'Ext.form.Panel',
        layout: 'form',
        height: 100,
        width: 100,
        labelMap: {
            textfieldLabel: 'write your name here'
        },
        
        initComponent : function () {
    
            var me = this;
    
            Ext.applyIf(me, {
                items: [{
                    xtype: 'textfield',
                    fieldLabel: this.labelMap.textfieldLabel
                }]
            });
    
            me.callParent(arguments);
        }
        
    });
    
    Ext.create('classname', {
        renderTo: Ext.getBody()
    });
    Regards,
    Scott.​

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi