var cfg = {};
+ if(this.inputType != 'hidden'){
+ cfg.cls = 'form-group' //input-group
+ }
+
var input = {
tag: 'textarea',
id : id,
}
if (align ==='left' && this.fieldLabel.length) {
-// Roo.log("left and has label");
- cfg.cn = [
-
- {
- tag: 'label',
- 'for' : id,
- cls : 'control-label col-sm-' + this.labelWidth,
- html : this.fieldLabel
-
- },
- {
- cls : "col-sm-" + (12 - this.labelWidth),
- cn: [
- inputblock
- ]
- }
-
- ];
+ cfg.cn = [
+ {
+ tag: 'label',
+ 'for' : id,
+ cls : 'control-label',
+ html : this.fieldLabel
+ },
+ {
+ cls : "",
+ cn: [
+ inputblock
+ ]
+ }
+
+ ];
+
+ if(this.labelWidth > 12){
+ cfg.cn[0].style = "width: " + this.labelWidth + 'px';
+ }
+
+ if(this.labelWidth < 13 && this.labelmd == 0){
+ this.labelmd = this.labelWidth;
+ }
+
+ if(this.labellg > 0){
+ cfg.cn[0].cls += ' col-lg-' + this.labellg;
+ cfg.cn[1].cls += ' col-lg-' + (12 - this.labellg);
+ }
+
+ if(this.labelmd > 0){
+ cfg.cn[0].cls += ' col-md-' + this.labelmd;
+ cfg.cn[1].cls += ' col-md-' + (12 - this.labelmd);
+ }
+
+ if(this.labelsm > 0){
+ cfg.cn[0].cls += ' col-sm-' + this.labelsm;
+ cfg.cn[1].cls += ' col-sm-' + (12 - this.labelsm);
+ }
+
+ if(this.labelxs > 0){
+ cfg.cn[0].cls += ' col-xs-' + this.labelxs;
+ cfg.cn[1].cls += ' col-xs-' + (12 - this.labelxs);
+ }
+
} else if ( this.fieldLabel.length) {
-// Roo.log(" label");
- cfg.cn = [
-
- {
- tag: 'label',
- //cls : 'input-group-addon',
- html : this.fieldLabel
-
- },
-
- inputblock
-
- ];
+ cfg.cn = [
+
+ {
+ tag: 'label',
+ //cls : 'input-group-addon',
+ html : this.fieldLabel
+
+ },
+
+ inputblock
+
+ ];
} else {
-
-// Roo.log(" no label && no align");
- cfg.cn = [
-
- inputblock
-
- ];
-
+
+ cfg.cn = [
+
+ inputblock
+
+ ];
}
icon.remove();
}
- this.el.removeClass(this.invalidClass);
+ this.el.removeClass([ this.invalidClass, 'is-invalid']);
if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){
return;
}
- this.el.removeClass([this.invalidClass, this.validClass]);
+ this.el.removeClass([this.invalidClass, this.validClass, 'is-valid', 'is-invalid']);
+
var feedback = this.el.select('.form-control-feedback', true).first();
if(label && icon){
icon.remove();
}
+ if (Roo.bootstrap.version == 3) {
+ this.el.addClass(this.validClass);
+ } else {
+ this.inputEl().addClass('is-valid');
+ }
- this.el.addClass(this.validClass);
if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank && (this.getValue().length || this.forceFeedback)){
return;
}
- this.el.removeClass([this.invalidClass, this.validClass]);
+ this.el.removeClass([this.invalidClass, this.validClass, 'is-valid', 'is-invalid']);
var feedback = this.el.select('.form-control-feedback', true).first();
style : 'margin-right:5px;'
}, label, true);
}
-
- this.el.addClass(this.invalidClass);
+ if (Roo.bootstrap.version == 3) {
+ this.el.addClass(this.invalidClass);
+ } else {
+ this.inputEl().addClass('is-invalid');
+ }
+
+ // fixme ... this may be depricated need to test..
if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){
var feedback = this.el.select('.form-control-feedback', true).first();