Browse Source

Merge pull request #27658 in DEC/fineui from master to feature/x

* commit 'e60d977be0ad7e5e5ae984163ac92675188675d6':
  REPORT-70807 fix:给watermark加个props
  REPORT-70807 fix:年份日期控件适配watermark
es6
superman 3 years ago
parent
commit
616ee6b2dd
  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