|
|
|
@ -17,16 +17,11 @@ Demo.Slider = BI.inherit(BI.Widget, {
|
|
|
|
|
digit: 0, |
|
|
|
|
width: o.width, |
|
|
|
|
height: o.height, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
singleSlider.setMinAndMax({ |
|
|
|
|
cls: "layout-bg-white", |
|
|
|
|
value: 30, |
|
|
|
|
min: 10, |
|
|
|
|
max: o.max |
|
|
|
|
max: 100 |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
singleSlider.setValue(30); |
|
|
|
|
singleSlider.populate(); |
|
|
|
|
singleSlider.on(BI.SingleSlider.EVENT_CHANGE, function () { |
|
|
|
|
console.log(this.getValue()); |
|
|
|
|
}); |
|
|
|
@ -35,14 +30,14 @@ Demo.Slider = BI.inherit(BI.Widget, {
|
|
|
|
|
type: "bi.single_slider_normal", |
|
|
|
|
width: o.width, |
|
|
|
|
height: 30, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
normalSingleSlider.setMinAndMax({ |
|
|
|
|
cls: "layout-bg-white", |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
max: o.max, |
|
|
|
|
value: 30, |
|
|
|
|
}); |
|
|
|
|
normalSingleSlider.on(BI.SingleSliderNormal.EVENT_DRAG, function () { |
|
|
|
|
console.log(this.getValue()); |
|
|
|
|
}); |
|
|
|
|
normalSingleSlider.setValue(10); |
|
|
|
|
normalSingleSlider.populate(); |
|
|
|
|
|
|
|
|
|
var singleSliderLabel = BI.createWidget({ |
|
|
|
|
type: "bi.single_slider_label", |
|
|
|
@ -50,47 +45,38 @@ Demo.Slider = BI.inherit(BI.Widget, {
|
|
|
|
|
height: o.height, |
|
|
|
|
digit: 0, |
|
|
|
|
unit: "个", |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
singleSliderLabel.setMinAndMax({ |
|
|
|
|
cls: "layout-bg-white", |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
max: o.max, |
|
|
|
|
value: 10, |
|
|
|
|
}); |
|
|
|
|
singleSliderLabel.setValue(10); |
|
|
|
|
singleSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
var intervalSlider = BI.createWidget({ |
|
|
|
|
type: "bi.interval_slider", |
|
|
|
|
width: o.width, |
|
|
|
|
digit: 0, |
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
}); |
|
|
|
|
intervalSlider.setMinAndMax({ |
|
|
|
|
cls: "layout-bg-white", |
|
|
|
|
min: o.min, |
|
|
|
|
max: o.max |
|
|
|
|
}); |
|
|
|
|
intervalSlider.setValue({ |
|
|
|
|
min: 10, |
|
|
|
|
max: 120 |
|
|
|
|
max: o.max, |
|
|
|
|
value: { |
|
|
|
|
min: 10, |
|
|
|
|
max: 70 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
intervalSlider.populate(); |
|
|
|
|
|
|
|
|
|
var intervalSliderLabel = BI.createWidget({ |
|
|
|
|
type: "bi.interval_slider", |
|
|
|
|
width: o.width, |
|
|
|
|
unit: "px", |
|
|
|
|
cls: "layout-bg-white", |
|
|
|
|
digit: 1 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.setMinAndMax({ |
|
|
|
|
digit: 1, |
|
|
|
|
min: 0, |
|
|
|
|
max: 120 |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.setValue({ |
|
|
|
|
min: 10, |
|
|
|
|
max: 120 |
|
|
|
|
max: 120, |
|
|
|
|
value: { |
|
|
|
|
min: 60, |
|
|
|
|
max: 120 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
intervalSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
@ -126,4 +112,4 @@ Demo.Slider = BI.inherit(BI.Widget, {
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
BI.shortcut("demo.slider", Demo.Slider); |
|
|
|
|
BI.shortcut("demo.slider", Demo.Slider); |
|
|
|
|