Results 1 to 4 of 4

Thread: How to get text from label?

  1. #1
    Ext User
    Join Date
    Jan 2009
    Posts
    543
    Vote Rating
    0
      0  

    Default How to get text from label?

    There does not seem to be a getText of a Label. Why not?

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    132
      0  

    Default

    Because you can simply read the 'text' or 'html' property.

    But if you insist:
    Code:
    Ext.override(Ext.form.Label, {
        getText : function(){
            return this.text || Ext.util.Format.htmlDecode(this.html);
        }
    });

  3. #3
    Ext User
    Join Date
    Jan 2009
    Posts
    543
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Condor View Post
    Because you can simply read the 'text' or 'html' property.

    But if you insist:
    Code:
    Ext.override(Ext.form.Label, {
        getText : function(){
            return this.text || Ext.util.Format.htmlDecode(this.html);
        }
    });
    I like this because it makes it consistent. Thanks.

  4. #4
    Ext User
    Join Date
    Oct 2009
    Posts
    16
    Vote Rating
    0
      0  

    Default getText

    Ext.override(Ext.form.Label, {
    getText : function(){
    return this.text || Ext.util.Format.htmlDecode(this.html);
    }
    });


    no longer works in 3.1, it returns undefined. is there an alternative?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •