forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.8 KiB
65 lines
1.8 KiB
/* 文件管理导航 |
|
Created by dailer on 2017 / 7 / 21. |
|
*/ |
|
Demo.FileManager = BI.inherit(BI.Widget, { |
|
props: { |
|
baseCls: "" |
|
}, |
|
|
|
render: function () { |
|
var editor1 = BI.createWidget({ |
|
type: "bi.number_editor", |
|
validationChecker: function (v) { |
|
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0; |
|
}, |
|
height: 24, |
|
width: 150, |
|
errorText: "hahah" |
|
}); |
|
editor1.on(BI.NumberEditor.EVENT_CHANGE, function () { |
|
if (BI.parseFloat(this.getValue()) < 1) { |
|
editor1.setDownEnable(false); |
|
} else { |
|
editor1.setDownEnable(true); |
|
} |
|
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", |
|
hgap: 20, |
|
vgap: 20, |
|
items: [ |
|
{ |
|
el: editor1, |
|
height: 24 |
|
}, { |
|
el: editor2, |
|
height: 24 |
|
} |
|
] |
|
}; |
|
} |
|
}); |
|
BI.shortcut("demo.number_editor", Demo.FileManager);
|
|
|