Browse Source

Pull request #2666: REPORT-70807 修复年份日期控件水印只显示无限制

Merge in VISUAL/fineui from ~FREDDY/fineui:master to master

* commit '6d30eca76f8d7f8d43c6d72ef7840e67e3238009':
  REPORT-70807 fix:给watermark加个props
  REPORT-70807 fix:年份日期控件适配watermark
es6
Freddy 3 years ago
parent
commit
e60d977be0
  1. 8
      src/widget/year/combo.year.js
  2. 9
      src/widget/year/trigger.year.js

8
src/widget/year/combo.year.js

@ -24,7 +24,8 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
min: o.minDate, min: o.minDate,
max: o.maxDate, max: o.maxDate,
height: o.height - border, height: o.height - border,
value: o.value || "" value: o.value || "",
watermark: o.watermark
}); });
this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN, function () { this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
@ -211,8 +212,11 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
isStateValid: function () { isStateValid: function () {
return this.trigger.isValid(); return this.trigger.isValid();
} },
setWaterMark: function (v) {
this.trigger.setWaterMark(v);
}
}); });
BI.DynamicYearCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";

9
src/widget/year/trigger.year.js

@ -10,7 +10,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
extraCls: "bi-year-trigger", extraCls: "bi-year-trigger",
min: "1900-01-01", // 最小日期 min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期 max: "2099-12-31", // 最大日期
height: 24 height: 24,
watermark: BI.i18nText("BI-Basic_Unrestricted")
}); });
}, },
@ -35,7 +36,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
}, },
hgap: c.hgap, hgap: c.hgap,
vgap: c.vgap, vgap: c.vgap,
watermark: BI.i18nText("BI-Basic_Unrestricted"), watermark: o.watermark,
allowBlank: true, allowBlank: true,
errorText: function (v) { errorText: function (v) {
if (BI.isPositiveInteger(v)) { if (BI.isPositiveInteger(v)) {
@ -188,6 +189,10 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
getKey: function () { getKey: function () {
return this.editor.getValue() | 0; return this.editor.getValue() | 0;
},
setWaterMark: function (v) {
this.editor.setWaterMark(v);
} }
}); });
BI.DynamicYearTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; BI.DynamicYearTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";

Loading…
Cancel
Save