Browse Source

REPORT-70807 fix:年份日期控件适配watermark

es6
freddy 3 years ago
parent
commit
fe722020d9
  1. 8
      src/widget/year/combo.year.js
  2. 6
      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,
max: o.maxDate,
height: o.height - border,
value: o.value || ""
value: o.value || "",
watermark: o.watermark
});
this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
@ -211,8 +212,11 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, {
isStateValid: function () {
return this.trigger.isValid();
}
},
setWaterMark: function (v) {
this.trigger.setWaterMark(v);
}
});
BI.DynamicYearCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";

6
src/widget/year/trigger.year.js

@ -35,7 +35,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
},
hgap: c.hgap,
vgap: c.vgap,
watermark: BI.i18nText("BI-Basic_Unrestricted"),
watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
errorText: function (v) {
if (BI.isPositiveInteger(v)) {
@ -188,6 +188,10 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
getKey: function () {
return this.editor.getValue() | 0;
},
setWaterMark: function (v) {
this.editor.setWaterMark(v);
}
});
BI.DynamicYearTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";

Loading…
Cancel
Save