|
|
|
@ -7,7 +7,7 @@ Demo.FileManager = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var editor = BI.createWidget({ |
|
|
|
|
var editor1 = BI.createWidget({ |
|
|
|
|
type: "bi.number_editor", |
|
|
|
|
validationChecker: function (v) { |
|
|
|
|
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0; |
|
|
|
@ -16,20 +16,49 @@ Demo.FileManager = BI.inherit(BI.Widget, {
|
|
|
|
|
width: 150, |
|
|
|
|
errorText: "hahah" |
|
|
|
|
}); |
|
|
|
|
editor.on(BI.NumberEditor.EVENT_CHANGE, function () { |
|
|
|
|
editor1.on(BI.NumberEditor.EVENT_CHANGE, function () { |
|
|
|
|
if (BI.parseFloat(this.getValue()) < 1) { |
|
|
|
|
editor.setDownEnable(false); |
|
|
|
|
editor1.setDownEnable(false); |
|
|
|
|
} else { |
|
|
|
|
editor.setDownEnable(true); |
|
|
|
|
editor1.setDownEnable(true); |
|
|
|
|
} |
|
|
|
|
BI.Msg.toast(editor.getValue()); |
|
|
|
|
BI.Msg.toast(editor1.getValue()); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var editor2 = BI.createWidget({ |
|
|
|
|
type: "bi.number_editor", |
|
|
|
|
validationChecker: function (v) { |
|
|
|
|
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0; |
|
|
|
|
}, |
|
|
|
|
valueFormatter: (v) => `${v}$`, |
|
|
|
|
valueParser: (v) => v.replace(/\$\s?|(,*)/g, ''), |
|
|
|
|
height: 24, |
|
|
|
|
width: 150, |
|
|
|
|
errorText: "hahah" |
|
|
|
|
}); |
|
|
|
|
editor2.on(BI.NumberEditor.EVENT_CHANGE, function () { |
|
|
|
|
if (BI.parseFloat(this.getValue()) < 1) { |
|
|
|
|
editor2.setDownEnable(false); |
|
|
|
|
} else { |
|
|
|
|
editor2.setDownEnable(true); |
|
|
|
|
} |
|
|
|
|
BI.Msg.toast(editor2.getValue()); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical", |
|
|
|
|
items: [{ |
|
|
|
|
el: editor, |
|
|
|
|
height: 24 |
|
|
|
|
}] |
|
|
|
|
hgap: 20, |
|
|
|
|
vgap: 20, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
el: editor1, |
|
|
|
|
height: 24 |
|
|
|
|
}, { |
|
|
|
|
el: editor2, |
|
|
|
|
height: 24 |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|