|
|
@ -18,7 +18,8 @@ BI.NumberEditor = BI.inherit(BI.Widget, { |
|
|
|
errorText: "", |
|
|
|
errorText: "", |
|
|
|
step: 1, |
|
|
|
step: 1, |
|
|
|
min: BI.MIN, |
|
|
|
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), |
|
|
|
height: BI.toPix(o.height, 2), |
|
|
|
simple: o.simple, |
|
|
|
simple: o.simple, |
|
|
|
allowBlank: o.allowBlank, |
|
|
|
allowBlank: o.allowBlank, |
|
|
|
|
|
|
|
watermark: o.watermark, |
|
|
|
value: o.valueFormatter(o.value), |
|
|
|
value: o.valueFormatter(o.value), |
|
|
|
validationChecker: function (v) { |
|
|
|
validationChecker: function (v) { |
|
|
|
// 不设置validationChecker就自动检测
|
|
|
|
// 不设置validationChecker就自动检测
|
|
|
@ -89,12 +91,14 @@ BI.NumberEditor = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.htape", |
|
|
|
type: "bi.htape", |
|
|
|
height: BI.toPix(o.height, 2), |
|
|
|
height: BI.toPix(o.height, 2), |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
items: [this.editor, { |
|
|
|
items: [ |
|
|
|
|
|
|
|
this.editor, { |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.grid", |
|
|
|
type: "bi.grid", |
|
|
|
columns: 1, |
|
|
|
columns: 1, |
|
|
|
rows: 2, |
|
|
|
rows: 2, |
|
|
|
items: [{ |
|
|
|
items: [ |
|
|
|
|
|
|
|
{ |
|
|
|
column: 0, |
|
|
|
column: 0, |
|
|
|
row: 0, |
|
|
|
row: 0, |
|
|
|
el: this.topBtn |
|
|
|
el: this.topBtn |
|
|
@ -102,10 +106,12 @@ BI.NumberEditor = BI.inherit(BI.Widget, { |
|
|
|
column: 0, |
|
|
|
column: 0, |
|
|
|
row: 1, |
|
|
|
row: 1, |
|
|
|
el: this.bottomBtn |
|
|
|
el: this.bottomBtn |
|
|
|
}] |
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
width: 23 |
|
|
|
width: 23 |
|
|
|
}] |
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -117,13 +123,13 @@ BI.NumberEditor = BI.inherit(BI.Widget, { |
|
|
|
return this.editor.isEditing(); |
|
|
|
return this.editor.isEditing(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_checkValueInRange: function(v) { |
|
|
|
_checkValueInRange: function (v) { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
return !!(BI.isNumeric(v) && BI.parseFloat(v) >= o.min && BI.parseFloat(v) <= o.max); |
|
|
|
return !!(BI.isNumeric(v) && BI.parseFloat(v) >= o.min && BI.parseFloat(v) <= o.max); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_checkAdjustDisabled: function(v) { |
|
|
|
_checkAdjustDisabled: function (v) { |
|
|
|
if(this.options.validationChecker === BI.emptyFn) { |
|
|
|
if (this.options.validationChecker === BI.emptyFn) { |
|
|
|
this.bottomBtn.setEnable(BI.parseFloat(v) > this.options.min); |
|
|
|
this.bottomBtn.setEnable(BI.parseFloat(v) > this.options.min); |
|
|
|
this.topBtn.setEnable(BI.parseFloat(v) < this.options.max); |
|
|
|
this.topBtn.setEnable(BI.parseFloat(v) < this.options.max); |
|
|
|
} |
|
|
|
} |
|
|
|