Available only in PRO Edition
The control is available only in Webix Pro edition.
Range Slider is an advanced Slider control that allows selecting a specific range of values with two markers.
The colored space between the markers defines the values included into the range.
{ view:"rangeslider", label:"Level B", value:[0,50], name:"s2"}
You can initialize RangeSlider both in the horizontal and vertical modes. A vertical range slider is presented in the image below:
To make the control vertical, set the vertical attribute of the rangeslider configuration object to true.
{ view:"rangeslider", value:"15,60", width:70, vertical:true },
Related sample: RangeSlider: Vertical
RangeSlider title is based on the current value of the control.
For a simple title that displays the current value and a static text, set a template via the webix.template class:
{view:"rangeslider", title:webix.template("Selected: #value#")}
For a complex title that changes its text depending on the current value, define a function template:
{view:"rangeslider", title:function(obj){
// title for values over 20
var text = obj.value > 20 ? "Minimum level reached. " : "";
return text + "Value: "+ obj.value;} // title for other values
}
By default, the rangeslider title is movable. You can change this behavior by setting the moveTitle property to false:
{view:"rangeslider", title:webix.template("Selected: #value#"), moveTitle:false}
Related sample: RangeSlider: Vertical
Make use of rangeslider events to set a changing title for a drag marker:
{view:"rangeslider", on:{
onChange:function(){
this.define("title", "Final value " + this.getValue());
this.refresh();
},
onSliderDrag:function(){
this.define("title", "Dragging... Currently "+this.getValue());
this.refresh();
}
}}
The new title is set with the help of the define method while the current value is derived with the getValue one.
Read more about Changing Properties of Components.
Back to top