diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index a99fa2ede..c2c3e4a73 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -16,7 +16,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { supportDynamic: true, attributes: { tabIndex: -1 - } + }, + isNeedAdjustHeight: false, + isNeedAdjustWidth: false }, _init: function () { @@ -53,8 +55,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { self.combo = this; }, toggle: false, - isNeedAdjustHeight: false, - isNeedAdjustWidth: false, + isNeedAdjustHeight: opts.isNeedAdjustHeight, + isNeedAdjustWidth: opts.isNeedAdjustWidth, destroyWhenHide: true, el: { type: "bi.dynamic_date_trigger", @@ -143,6 +145,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { popup: { el: { type: "bi.dynamic_date_popup", + width: opts.isNeedAdjustWidth ? opts.width : undefined, supportDynamic: opts.supportDynamic, behaviors: opts.behaviors, min: opts.minDate, diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 915430b12..b4fe649a1 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -16,7 +16,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { supportDynamic: true, attributes: { tabIndex: -1 - } + }, + isNeedAdjustHeight: false, + isNeedAdjustWidth: false }, _init: function () { @@ -54,8 +56,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { self.combo = this; }, toggle: false, - isNeedAdjustHeight: false, - isNeedAdjustWidth: false, + isNeedAdjustHeight: opts.isNeedAdjustHeight, + isNeedAdjustWidth: opts.isNeedAdjustWidth, el: { type: "bi.dynamic_date_time_trigger", min: opts.minDate, @@ -148,6 +150,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { popup: { el: { type: "bi.dynamic_date_time_popup", + width: opts.isNeedAdjustWidth ? opts.width : undefined, supportDynamic: opts.supportDynamic, behaviors: opts.behaviors, min: opts.minDate, diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index 24ad058e0..dcd6c2799 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -17,6 +17,8 @@ height: 24, format: "", allowEdit: false, + isNeedAdjustHeight: false, + isNeedAdjustWidth: false }, _init: function () { @@ -66,8 +68,8 @@ cls: "bi-border bi-border-radius bi-focus-shadow", container: opts.container, toggle: false, - isNeedAdjustHeight: false, - isNeedAdjustWidth: false, + isNeedAdjustHeight: opts.isNeedAdjustHeight, + isNeedAdjustWidth: opts.isNeedAdjustWidth, el: { type: "bi.time_trigger", height: opts.height, @@ -150,7 +152,7 @@ adjustLength: this.constants.comboAdjustHeight, popup: { el: popup, - width: this.constants.popupWidth, + width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth, stopPropagation: false }, hideChecker: function (e) { diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index d1500d969..5b7bd5fa6 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/src/widget/yearmonth/combo.yearmonth.js @@ -6,7 +6,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { minDate: "1900-01-01", // 最小日期 maxDate: "2099-12-31", // 最大日期 height: 24, - supportDynamic: true + supportDynamic: true, + isNeedAdjustHeight: false, + isNeedAdjustWidth: false }, _init: function () { @@ -60,8 +62,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { this.combo = BI.createWidget({ type: "bi.combo", container: o.container, - isNeedAdjustHeight: false, - isNeedAdjustWidth: false, + isNeedAdjustHeight: o.isNeedAdjustHeight, + isNeedAdjustWidth: o.isNeedAdjustWidth, el: this.trigger, destroyWhenHide: true, adjustLength: 1, @@ -70,6 +72,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { stopPropagation: false, el: { type: "bi.dynamic_year_month_popup", + width: o.isNeedAdjustWidth ? o.width : undefined, supportDynamic: o.supportDynamic, ref: function () { self.popup = this; diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index fca8ce2f1..32830ea26 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/src/widget/yearquarter/combo.yearquarter.js @@ -7,6 +7,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { maxDate: "2099-12-31", // 最大日期 height: 24, supportDynamic: true, + isNeedAdjustHeight: false, + isNeedAdjustWidth: false }, _init: function () { @@ -60,8 +62,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { this.combo = BI.createWidget({ type: "bi.combo", container: o.container, - isNeedAdjustHeight: false, - isNeedAdjustWidth: false, + isNeedAdjustHeight: o.isNeedAdjustHeight, + isNeedAdjustWidth: o.isNeedAdjustWidth, el: this.trigger, destroyWhenHide: true, adjustLength: 1, @@ -70,6 +72,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { stopPropagation: false, el: { type: "bi.dynamic_year_quarter_popup", + width: o.isNeedAdjustWidth ? o.width : undefined, supportDynamic: o.supportDynamic, ref: function () { self.popup = this;