* @cfg {string} dayFormat default 'd'
* @cfg {string} monthFormat default 'm'
* @cfg {string} yearFormat default 'Y'
+ * @cfg {Number} labellg set the width of label (1-12)
+ * @cfg {Number} labelmd set the width of label (1-12)
+ * @cfg {Number} labelsm set the width of label (1-12)
+ * @cfg {Number} labelxs set the width of label (1-12)
*
* @constructor
monthFormat : 'm',
yearFormat : 'Y',
isFormField : true,
+ labellg : 0,
+ labelmd : 0,
+ labelsm : 0,
+ labelxs : 0,
getAutoCreate : function()
{
]
};
+ var labelCls = 'col-md-12';
+ var contentCls = 'col-md-4';
+
if(this.fieldLabel){
- cfg.cn.push({
+
+ var label = {
tag : 'div',
cls : 'column roo-date-split-field-label col-md-' + ((this.labelAlign == 'top') ? '12' : this.labelWidth),
cn : [
html : this.fieldLabel
}
]
- });
+ };
+
+ if(this.labelAlign == 'left'){
+
+ if(this.labelWidth > 12){
+ label.style = "width: " + this.labelWidth + 'px';
+ }
+
+ if(this.labelWidth < 13 && this.labelmd == 0){
+ this.labelmd = this.labelWidth;
+ }
+
+ if(this.labellg > 0){
+ labelCls = ' col-lg-' + this.labellg;
+ contentCls = ' col-lg-' + ((12 - this.labellg) / 3);
+ }
+
+ if(this.labelmd > 0){
+ labelCls = ' col-md-' + this.labelmd;
+ contentCls = ' col-md-' + ((12 - this.labelmd) / 3);
+ }
+
+ if(this.labelsm > 0){
+ labelCls = ' col-sm-' + this.labelsm;
+ contentCls = ' col-sm-' + ((12 - this.labelsm) / 3);
+ }
+
+ if(this.labelxs > 0){
+ labelCls = ' col-xs-' + this.labelxs;
+ contentCls = ' col-xs-' + ((12 - this.labelxs) / 3);
+ }
+ }
+
+ label.cls += ' ' + labelCls;
+
+ cfg.cn.push(label);
}
Roo.each(['day', 'month', 'year'], function(t){
cfg.cn.push({
tag : 'div',
- cls : 'column roo-date-split-field-' + t + ' col-md-' + ((this.labelAlign == 'top') ? '4' : ((12 - this.labelWidth) / 3))
+ cls : 'column roo-date-split-field-' + t + ' ' + contentCls
});
}, this);
mode : 'local',
placeholder : this.dayPlaceholder,
selectOnFocus : true,
- tpl : '<div class="select2-result"><b>{value}</b></div>',
+ tpl : '<div class="roo-select2-result"><b>{value}</b></div>',
triggerAction : 'all',
typeAhead : true,
valueField : 'value',
mode : 'local',
placeholder : this.yearPlaceholder,
selectOnFocus : true,
- tpl : '<div class="select2-result"><b>{value}</b></div>',
+ tpl : '<div class="roo-select2-result"><b>{value}</b></div>',
triggerAction : 'all',
typeAhead : true,
valueField : 'value',
validate : function()
{
- Roo.log('run validate?????????????????????????????????????????????????????????????');
-
var d = this.dayField.validate();
var m = this.monthField.validate();
var y = this.yearField.validate();
markValid : function()
{
- Roo.log('run mark valid?????????????????????????????????????????????????????????????');
+
var label = this.el.select('label', true).first();
var icon = this.el.select('i.fa-star', true).first();
*/
markInvalid : function(msg)
{
- Roo.log('run mark invalid?????????????????????????????????????????????????????????????');
+
var label = this.el.select('label', true).first();
var icon = this.el.select('i.fa-star', true).first();
clearInvalid : function()
{
- Roo.log('run clear valid?????????????????????????????????????????????????????????????');
var label = this.el.select('label', true).first();
var icon = this.el.select('i.fa-star', true).first();