|
|
@ -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,23 +91,27 @@ 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: [ |
|
|
|
el: { |
|
|
|
this.editor, { |
|
|
|
type: "bi.grid", |
|
|
|
el: { |
|
|
|
columns: 1, |
|
|
|
type: "bi.grid", |
|
|
|
rows: 2, |
|
|
|
columns: 1, |
|
|
|
items: [{ |
|
|
|
rows: 2, |
|
|
|
column: 0, |
|
|
|
items: [ |
|
|
|
row: 0, |
|
|
|
{ |
|
|
|
el: this.topBtn |
|
|
|
column: 0, |
|
|
|
}, { |
|
|
|
row: 0, |
|
|
|
column: 0, |
|
|
|
el: this.topBtn |
|
|
|
row: 1, |
|
|
|
}, { |
|
|
|
el: this.bottomBtn |
|
|
|
column: 0, |
|
|
|
}] |
|
|
|
row: 1, |
|
|
|
}, |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|