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