|
|
@ -13,24 +13,27 @@ $(function () { |
|
|
|
* Created by Urthur on 2017/9/4. |
|
|
|
* Created by Urthur on 2017/9/4. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Demo.Slider = BI.inherit(BI.Widget, { |
|
|
|
Demo.Slider = BI.inherit(BI.Widget, { |
|
|
|
_props: { |
|
|
|
props: { |
|
|
|
baseCls: "demo-slider", |
|
|
|
baseCls: "demo-slider", |
|
|
|
min: 10, |
|
|
|
width: 300, |
|
|
|
max: 50 |
|
|
|
height: 50, |
|
|
|
|
|
|
|
min: 0, |
|
|
|
|
|
|
|
max: 100 |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
render: function () { |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
var singleSlider = BI.createWidget({ |
|
|
|
var singleSlider = BI.createWidget({ |
|
|
|
type: "bi.single_slider", |
|
|
|
type: "bi.single_slider", |
|
|
|
digit: 0, |
|
|
|
digit: 0, |
|
|
|
width: 300, |
|
|
|
width: o.width, |
|
|
|
height: 50, |
|
|
|
height: o.height, |
|
|
|
cls: "layout-bg-white" |
|
|
|
cls: "layout-bg-white" |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
singleSlider.setMinAndMax({ |
|
|
|
singleSlider.setMinAndMax({ |
|
|
|
min: 10, |
|
|
|
min: 10, |
|
|
|
max: 100 |
|
|
|
max: o.max |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
singleSlider.setValue(30); |
|
|
|
singleSlider.setValue(30); |
|
|
@ -39,43 +42,42 @@ Demo.Slider = BI.inherit(BI.Widget, { |
|
|
|
console.log(this.getValue()); |
|
|
|
console.log(this.getValue()); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var singleSliderLabel = BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.single_slider_label", |
|
|
|
|
|
|
|
height: 50, |
|
|
|
|
|
|
|
width: 300, |
|
|
|
|
|
|
|
digit: 0, |
|
|
|
|
|
|
|
unit: "个", |
|
|
|
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
singleSliderLabel.setMinAndMax({ |
|
|
|
|
|
|
|
min: 0, |
|
|
|
|
|
|
|
max: 100 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
singleSliderLabel.setValue(10); |
|
|
|
|
|
|
|
singleSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var normalSingleSlider = BI.createWidget({ |
|
|
|
var normalSingleSlider = BI.createWidget({ |
|
|
|
type: "bi.single_slider_normal", |
|
|
|
type: "bi.single_slider_normal", |
|
|
|
|
|
|
|
width: o.width, |
|
|
|
height: 30, |
|
|
|
height: 30, |
|
|
|
width: 300, |
|
|
|
|
|
|
|
cls: "layout-bg-white" |
|
|
|
cls: "layout-bg-white" |
|
|
|
}); |
|
|
|
}); |
|
|
|
normalSingleSlider.setMinAndMax({ |
|
|
|
normalSingleSlider.setMinAndMax({ |
|
|
|
min: 0, |
|
|
|
min: o.min, |
|
|
|
max: 100 |
|
|
|
max: o.max |
|
|
|
}); |
|
|
|
}); |
|
|
|
normalSingleSlider.setValue(10); |
|
|
|
normalSingleSlider.setValue(10); |
|
|
|
normalSingleSlider.populate(); |
|
|
|
normalSingleSlider.populate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var singleSliderLabel = BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.single_slider_label", |
|
|
|
|
|
|
|
width: o.width, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
digit: 0, |
|
|
|
|
|
|
|
unit: "个", |
|
|
|
|
|
|
|
cls: "layout-bg-white" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
singleSliderLabel.setMinAndMax({ |
|
|
|
|
|
|
|
min: o.min, |
|
|
|
|
|
|
|
max: o.max |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
singleSliderLabel.setValue(10); |
|
|
|
|
|
|
|
singleSliderLabel.populate(); |
|
|
|
|
|
|
|
|
|
|
|
var intervalSlider = BI.createWidget({ |
|
|
|
var intervalSlider = BI.createWidget({ |
|
|
|
type: "bi.interval_slider", |
|
|
|
type: "bi.interval_slider", |
|
|
|
width: 300, |
|
|
|
width: o.width, |
|
|
|
cls: "layout-bg-white" |
|
|
|
cls: "layout-bg-white" |
|
|
|
}); |
|
|
|
}); |
|
|
|
intervalSlider.setMinAndMax({ |
|
|
|
intervalSlider.setMinAndMax({ |
|
|
|
min: 0, |
|
|
|
min: o.min, |
|
|
|
max: 120 |
|
|
|
max: o.max |
|
|
|
}); |
|
|
|
}); |
|
|
|
intervalSlider.setValue({ |
|
|
|
intervalSlider.setValue({ |
|
|
|
min: 10, |
|
|
|
min: 10, |
|
|
@ -85,7 +87,7 @@ Demo.Slider = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
var intervalSliderLabel = BI.createWidget({ |
|
|
|
var intervalSliderLabel = BI.createWidget({ |
|
|
|
type: "bi.interval_slider_label", |
|
|
|
type: "bi.interval_slider_label", |
|
|
|
width: 300, |
|
|
|
width: o.width, |
|
|
|
unit: "个", |
|
|
|
unit: "个", |
|
|
|
cls: "layout-bg-white" |
|
|
|
cls: "layout-bg-white" |
|
|
|
}); |
|
|
|
}); |
|
|
|