Browse Source

BI-59128 style:单值滑块错误语句提示文本

es6
Tangjinxia 4 years ago
parent
commit
71adf0adcd
  1. 9
      src/widget/singleslider/singleslider.js

9
src/widget/singleslider/singleslider.js

@ -16,7 +16,8 @@ BI.SingleSlider = BI.inherit(BI.Single, {
props: {
baseCls: "bi-single-slider bi-slider-track",
digit: false,
unit: ""
unit: "",
errorText: ""
},
render: function () {
@ -315,14 +316,18 @@ BI.SingleSlider = BI.inherit(BI.Single, {
this.min = 0;
this.max = 0;
this._setBlueTrack(0);
},
populate: function () {
var o = this.options;
if (!isNaN(this.min) && !isNaN(this.max)) {
this._setVisible(true);
this.enable = true;
if (BI.isNotEmptyString(o.errorText)) {
this.label.setErrorText(o.errorText);
} else {
this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between", this.min, this.max));
}
if (BI.isNumeric(this.value) || BI.isNotEmptyString(this.value)) {
this.label.setValue(this.value);
this._setAllPosition(this._getPercentByValue(this.value));

Loading…
Cancel
Save