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
+
+ ];
}
/**
* Clear any invalid styles/messages for this field
*/
- clearInvalid : function(){
+ clearInvalid : function()
+ {
if(!this.el || this.preventMark){ // not rendered
return;
}
- this.el.removeClass(this.invalidClass);
+ var label = this.el.select('label', true).first();
+ var icon = this.el.select('i.fa-star', true).first();
+ if(label && icon){
+ icon.remove();
+ }
+ this.el.removeClass( this.validClass);
+ this.inputEl().removeClass('is-invalid');
+
if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank){
var feedback = this.el.select('.form-control-feedback', true).first();
}
this.el.removeClass([this.invalidClass, this.validClass]);
+ this.inputEl().removeClass(['is-valid', 'is-invalid']);
var feedback = this.el.select('.form-control-feedback', true).first();
return;
}
- var formGroup = this.el.findParent('.form-group', false, true);
+ var label = this.el.select('label', true).first();
+ var icon = this.el.select('i.fa-star', true).first();
- if(formGroup){
-
- var label = formGroup.select('label', true).first();
- var icon = formGroup.select('i.fa-star', true).first();
-
- if(label && icon){
- icon.remove();
- }
+ 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)){
}
this.el.removeClass([this.invalidClass, this.validClass]);
+ this.inputEl().removeClass(['is-valid', 'is-invalid']);
var feedback = this.el.select('.form-control-feedback', true).first();
}
var label = this.el.select('label', true).first();
- var icon = thie.el.select('i.fa-star', true).first();
+ var icon = this.el.select('i.fa-star', true).first();
if(!this.getValue().length && label && !icon){
this.el.createChild({
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();