Hybrid View

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Coimbatore,India
    Posts
    14
    Vote Rating
    0
    murugapradeep is on a distinguished road

      0  

    Question Dynamically Changing the Form label

    Dynamically Changing the Form label


    Hello,

    Is there any way to change the field label in the form dynamically?
    if you have any ideas please guide me to do this.


    Thanks in advance

  2. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    Hello.
    Actually there is not a function like "setLabel" defined for "Ext.form.Field" components that makes you change easily the label value.
    However, I wrote you a simple example that show you how to do what you request.

    Code:
    Ext.setup({
        onReady: function() {
            
            var form = new Ext.form.FormPanel({
                fullscreen: true,
                dockedItems: [{
                    xtype: 'toolbar',
                    title: 'Example',
                    items: [{
                        xtype: 'button',
                        text: 'Change Label',
                        handler: function(){
                        
                            //Set the new label value
                            form.getComponent('txtFirst').labelEl.dom.innerHTML = 'Hello';
                    
                        }
                    }]
                }],
                items: [{
                    xtype: 'textfield',
                    itemId: 'txtFirst',
                    name : 'first',
                    label: 'First name'
                }]
            });
        }
        
    });
    What I do in this example is take the wanted Field component from the form and then change the innerHTML of the labelEl.

    Hope this helps.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  3. #3
    Sencha User
    Join Date
    Jun 2011
    Location
    Coimbatore,India
    Posts
    14
    Vote Rating
    0
    murugapradeep is on a distinguished road

      0  

    Talking


    Thanks a lot for your reply , I got it.

  4. #4
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    You are welcome.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  5. #5
    Sencha User
    Join Date
    Aug 2009
    Posts
    96
    Vote Rating
    1
    r4nd7263 is on a distinguished road

      0  

    Default


    Why no "setLabel" ?

Thread Participants: 2

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