1. #11
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    87
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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
    176
    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 Premium Member i.stojanovic's Avatar
    Join Date
    Oct 2010
    Location
    Kragujevac, Serbia
    Posts
    24
    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.

  7. #17
    Sencha User
    Join Date
    Oct 2012
    Posts
    30
    Vote Rating
    0
    namrms is on a distinguished road

      0  

    Default


    Ext.getCmp('daterange').labelEl.update('Range '); works for me on Ext 4.0

  8. #18
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    ngocdoangia is on a distinguished road

      0  

    Default


    thank you very much
    cty thiet bi van phong pham chuyen mua ban văn phòng phẩm tất cả đều lam dep

  9. #19
    Sencha User
    Join Date
    Jul 2011
    Posts
    2
    Vote Rating
    0
    stephansun is on a distinguished road

      0  

    Default thanks

    thanks


    Quote Originally Posted by Condor View Post
    I would recommend:
    Code:
    Ext.override(Ext.form.Field, {  setFieldLabel : function(text) {    if (this.rendered) {      this.el.up('.x-form-item', 10, true).child('.x-form-item-label').update(text);    }    this.fieldLabel = text;  }});
    thanks, completely works for ExtJS 3

  10. #20
    Sencha User
    Join Date
    Nov 2013
    Posts
    4
    Vote Rating
    0
    Clint Mercado is on a distinguished road

      0  

    Default


    I've tried this but it only fire once. Why is that?

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..."