Clear Up
SharpKit Reference

TextArea Class

This class creates a multiline text field, which can be used as a direct replacement for traditional textarea fields. In addition, it supports automatically growing the height of the textarea to fit its content.

All of the configuration options from Ext.form.field.Text can be used on TextArea.

Example usage:

  
    Ext.create('Ext.form.FormPanel', {
            title      : 'Sample TextArea',
            width      : 400,
            bodyPadding: 10,
            renderTo   : Ext.getBody(),
            items: [{
            xtype     : 'textareafield',
            grow      : true,
            name      : 'message',
            fieldLabel: 'Message',
            anchor    : '100%'
            }]
            });
            

Some other useful configuration options when using grow are growMin and growMax. These allow you to set the minimum and maximum grow heights for the textarea.

NOTE: In some browsers, carriage returns ('\r', not to be confused with new lines) will be automatically stripped out the value is set to the textarea. Since we cannot use any reasonable method to attempt to re-insert these, they will automatically be stripped out to ensure the behaviour is consistent across browser.

Namespace: Ext.form.field

Fields

Name Description
cols An initial value for the 'cols' attribute on the textarea element. This is only used if the component has no configured width and is not given a width by its container's layout. Defaults to: 20
enterIsSpecial True if you want the ENTER key to be classed as a special key and the specialkey event to be fired when ENTER is pressed. Defaults to: false
preventScrollbars true to prevent scrollbars from appearing regardless of how much text is in the field. This option is only relevant when grow is true. Equivalent to setting overflow: hidden. Defaults to: false
rows An initial value for the 'rows' attribute on the textarea element. This is only used if the component has no configured height and is not given a height by its container's layout. Defaults to 4. Defaults to: 4
© Copyright 2005-2011 SharpKit. All rights reserved.