9 * @class Roo.bootstrap.TextArea
10 * @extends Roo.bootstrap.Input
11 * Bootstrap TextArea class
12 * @cfg {Number} cols Specifies the visible width of a text area
13 * @cfg {Number} rows Specifies the visible number of lines in a text area
14 * @cfg {string} wrap (soft|hard)Specifies how the text in a text area is to be wrapped when submitted in a form
15 * @cfg {string} resize (none|both|horizontal|vertical|inherit|initial)
16 * @cfg {string} html text
19 * Create a new TextArea
20 * @param {Object} config The config object
23 Roo.bootstrap.TextArea = function(config){
24 Roo.bootstrap.TextArea.superclass.constructor.call(this, config);
28 Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input, {
38 getAutoCreate : function(){
40 var align = (!this.labelAlign) ? this.parentLabelAlign() : this.labelAlign;
51 value : this.value || '',
52 html: this.html || '',
54 placeholder : this.placeholder || ''
58 if(this.maxLength && this.maxLength != Number.MAX_VALUE){
59 input.maxLength = this.maxLength;
63 input.style = (typeof(input.style) == 'undefined') ? 'resize:' + this.resize : input.style + 'resize:' + this.resize;
67 input.cols = this.cols;
71 input.readonly = true;
75 input.name = this.name;
79 input.cls = (typeof(input.cls) == 'undefined') ? 'input-' + this.size : input.cls + ' input-' + this.size;
83 ['xs','sm','md','lg'].map(function(size){
85 cfg.cls += ' col-' + size + '-' + settings[size];
89 var inputblock = input;
95 cls: 'glyphicon form-control-feedback'
108 if (this.before || this.after) {
117 cls : 'input-group-addon',
122 inputblock.cn.push(input);
124 if(this.hasFeedback){
125 inputblock.cls += ' has-feedback';
126 inputblock.cn.push(feedback);
132 cls : 'input-group-addon',
139 if (align ==='left' && this.fieldLabel.length) {
140 Roo.log("left and has label");
146 cls : 'control-label col-sm-' + this.labelWidth,
147 html : this.fieldLabel
151 cls : "col-sm-" + (12 - this.labelWidth),
158 } else if ( this.fieldLabel.length) {
164 //cls : 'input-group-addon',
165 html : this.fieldLabel
175 Roo.log(" no label && no align");
193 * return the real textarea element.
197 return this.el.select('textarea.form-control',true).first();