Results 1 to 2 of 2

Thread: Extjs 3.4 textarea height reset

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default Extjs 3.4 textarea height reset

    Hi,

    I want to reset the height of auto growing textarea to its original height once it is set to empty. But because of the "emptyText", textarea expands itself.
    Is there any way to configure textarea so that it does not consider "emptyText" for expending height.

    Thanks...

  2. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,147
    Vote Rating
    34
      0  

    Default

    Well this is a 4.1 forum but...

    If it grows to fit the text then you can set a new Height with getHeight(defaultHeight)

    Or override this function to you needs

    Code:
    setValue : function(v){
            if(this.emptyText && this.el && !Ext.isEmpty(v)){
                this.el.removeClass(this.emptyClass);
            }
            Ext.form.TextField.superclass.setValue.apply(this, arguments);
            this.applyEmptyText();
            this.autoSize();
            return this;
        },
    Switch the order
    Code:
    this.autoSize();
    this.applyEmptyText();
    First autosize then set emptytext

Posting Permissions

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