1. #11
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    44
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    That's completely correct, but the 'label' property is only available in Ext 3.0.1 and up.

    So for older Ext versions you would use the code from post #7.

  2. #12
    Ext JS Premium Member Joyfulbob's Avatar
    Join Date
    Feb 2008
    Posts
    172
    Vote Rating
    1
    Joyfulbob is on a distinguished road

      0  

    Default


    Quote Originally Posted by arefin View Post
    I used Ext.getCmp('daterange').label.update('Range '); and it works.
    Tell me if I am wrong.
    This works for me; thanks! We can use this a lot to reduce form size.

  3. #13
    Sencha User i.stojanovic's Avatar
    Join Date
    Oct 2010
    Location
    Kragujevac, Serbia
    Posts
    22
    Vote Rating
    0
    i.stojanovic is on a distinguished road

      0  

    Default change fieldLabel in ExtJS 4

    change fieldLabel in ExtJS 4


    Hi,

    If you want to change the label in ExtJS 4, here are solutions

    PHP Code:
    Ext.override(Ext.form.Field, {
        
    setFieldLabel : function(text) {
            if (
    this.renderedExt.get(this.labelEl.id).update(text);
            
    this.fieldLabel text;
        }
    }); 
    It is necessary to define an initial value for fieldLabel, can not be an empty string (  can)

  4. #14
    Sencha User
    Join Date
    Jan 2009
    Posts
    37
    Vote Rating
    0
    nfuids is on a distinguished road

      0  

    Default


    I think the method applyFieldLabel(value) should be overwritten... as explained in the article http://docs.sencha.com/ext-js/4-0/#!/guide/class_system



  5. #15
    Sencha User
    Join Date
    Aug 2011
    Posts
    1
    Vote Rating
    0
    bugfixer is on a distinguished road

      0  

    Thumbs up


    Quote Originally Posted by arefin View Post
    I used Ext.getCmp('daterange').label.update('Range '); and it works.
    Tell me if I am wrong.
    thanxxx arefin... its workes great.....

  6. #16
    Sencha User
    Join Date
    Mar 2012
    Location
    Indonesia
    Posts
    1
    Vote Rating
    0
    endipratama is on a distinguished road

      0  

    Default


    For ExtJS 4 user, you can replace label with labelEl, if you want to use this line of code.

    Code:
    Ext.getCmp('field_id').label.update('text_to_change');
    replace with:

    Code:
    Ext.getCmp('field_id').labelEl.update('text_to_change');

    because, i tried with label and it not worked for me. but after replace label with labelEl, it works.