|
|
|
@ -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,23 +91,27 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
|
|
|
|
|
type: "bi.htape", |
|
|
|
|
height: BI.toPix(o.height, 2), |
|
|
|
|
element: this, |
|
|
|
|
items: [this.editor, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.grid", |
|
|
|
|
columns: 1, |
|
|
|
|
rows: 2, |
|
|
|
|
items: [{ |
|
|
|
|
column: 0, |
|
|
|
|
row: 0, |
|
|
|
|
el: this.topBtn |
|
|
|
|
}, { |
|
|
|
|
column: 0, |
|
|
|
|
row: 1, |
|
|
|
|
el: this.bottomBtn |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
width: 23 |
|
|
|
|
}] |
|
|
|
|
items: [ |
|
|
|
|
this.editor, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.grid", |
|
|
|
|
columns: 1, |
|
|
|
|
rows: 2, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
column: 0, |
|
|
|
|
row: 0, |
|
|
|
|
el: this.topBtn |
|
|
|
|
}, { |
|
|
|
|
column: 0, |
|
|
|
|
row: 1, |
|
|
|
|
el: this.bottomBtn |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
width: 23 |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -117,13 +123,13 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
|
|
|
|
|
return this.editor.isEditing(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_checkValueInRange: function(v) { |
|
|
|
|
_checkValueInRange: function (v) { |
|
|
|
|
var o = this.options; |
|
|
|
|
return !!(BI.isNumeric(v) && BI.parseFloat(v) >= o.min && BI.parseFloat(v) <= o.max); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_checkAdjustDisabled: function(v) { |
|
|
|
|
if(this.options.validationChecker === BI.emptyFn) { |
|
|
|
|
_checkAdjustDisabled: function (v) { |
|
|
|
|
if (this.options.validationChecker === BI.emptyFn) { |
|
|
|
|
this.bottomBtn.setEnable(BI.parseFloat(v) > this.options.min); |
|
|
|
|
this.topBtn.setEnable(BI.parseFloat(v) < this.options.max); |
|
|
|
|
} |
|
|
|
|