Browse Source

无JIRA "bi.number_editor" 支持水印

research/test
zsmj 2 years ago
parent
commit
331d271019
  1. 3
      demo/js/widget/numbereditor/demo.number_editor.js
  2. 16
      src/widget/numbereditor/number.editor.js

3
demo/js/widget/numbereditor/demo.number_editor.js

@ -14,7 +14,8 @@ Demo.FileManager = BI.inherit(BI.Widget, {
},
height: 24,
width: 150,
errorText: "hahah"
errorText: "hahah",
watermark: "每个人都是自己健康的第一责任人",
});
editor1.on(BI.NumberEditor.EVENT_CHANGE, function () {
if (BI.parseFloat(this.getValue()) < 1) {

16
src/widget/numbereditor/number.editor.js

@ -18,7 +18,8 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: "",
step: 1,
min: BI.MIN,
max: BI.MAX
max: BI.MAX,
watermark: "",
});
},
@ -30,6 +31,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
height: BI.toPix(o.height, 2),
simple: o.simple,
allowBlank: o.allowBlank,
watermark: o.watermark,
value: o.valueFormatter(o.value),
validationChecker: function (v) {
// 不设置validationChecker就自动检测
@ -89,12 +91,14 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
type: "bi.htape",
height: BI.toPix(o.height, 2),
element: this,
items: [this.editor, {
items: [
this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
items: [
{
column: 0,
row: 0,
el: this.topBtn
@ -102,10 +106,12 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
column: 0,
row: 1,
el: this.bottomBtn
}]
}
]
},
width: 23
}]
}
]
});
},

Loading…
Cancel
Save