UI Widgets RangeSlider

A widget that enables a user to select a range of numeric values.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/range_slider
RangeSlider interactive configuration
Copy code
$("#rangeslider").dxRangeSlider({
});

The RangeSlider widget allows a user to specify a range of values.

You can create a widget using one of the following approaches.

  • jQuery
    Use the dxRangeSlider jQuery plug-in.

    HTML
    <div id="rangeSlider"></div>
    JavaScript
    $("#rangeSlider").dxRangeSlider({
        min: 0,
        max: 100
        step: 5,
        label: {
            visible: true,
            position: 'bottom'
        }
    });
  • Knockout
    Add a div element and apply the dxRangeSlider binding to this element.

    HTML
    <div data-bind="dxRangeSlider: {
        min: 0,
        max: 100
        step: 5,
        label: {
            visible: true,
            position: 'bottom'
        }
    }"></div>
  • AngularJS
    Add a div element and apply the dx-range-slider directive to this element.

    HTML
    <div dx-range-slider="{
        min: 0,
        max: 100
        step: 5,
        label: {
            visible: true,
            position: 'bottom'
        }
    }"></div>

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

You can find the detailed information on principles of working with the widget in the dxRangeSlider section of the Editor Widgets article.

View Demo

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController">
    <div dx-range-slider="{
        min:50,
        max: 100,
        bindingOptions: {
            start: 'rangeStart',
            end: 'rangeEnd'
        }
    }"></div>
    <div class="dx-fieldset">
        <div class="dx-field">
            <div class="dx-field-label">From</div>
            <div class="dx-field-value">{{rangeStart}}</div>
        </div>
        <div class="dx-field">
            <div class="dx-field-label">To</div>
            <div class="dx-field-value">{{rangeEnd}}</div>
        </div>
    </div>
</div>
var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function ($scope) {
    $scope.rangeStart = 65;
    $scope.rangeEnd = 85;
});
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
body{
    text-align: center;
}
.dx-rangeslider{
    margin: 10px;
}
<div data-bind="dxRangeSlider: {
    min:50,
    max: 100,
    start: rangeStart,
    end: rangeEnd
}"></div>
<div class="dx-fieldset">
    <div class="dx-field">
        <div class="dx-field-label">From</div>
        <div class="dx-field-value" data-bind="text: rangeStart"></div>
    </div>
    <div class="dx-field">
        <div class="dx-field-label">To</div>
        <div class="dx-field-value" data-bind="text: rangeEnd"></div>
    </div>
</div>
var myViewModel = {
    rangeStart: ko.observable(65),
    rangeEnd: ko.observable(85)
}
ko.applyBindings(myViewModel);
body{
    text-align: center;
}
.dx-rangeslider{
    margin: 10px;
}
<div id="myRangeSlider"></div>
<div class="dx-fieldset">
    <div class="dx-field">
        <div class="dx-field-label">From</div>
        <div class="dx-field-value" id="rangeStart">65</div>
    </div>
    <div class="dx-field">
        <div class="dx-field-label">To</div>
        <div class="dx-field-value" id="rangeEnd">85</div>
    </div>
</div>
$("#myRangeSlider").dxRangeSlider({
    min: 50,
    max: 100,
    start: 65,
    end: 85,
    onValueChanged: function (e) {
        $("#rangeStart").text(e.start);
        $("#rangeEnd").text(e.end);
    }
});
body{
    text-align: center;
}
.dx-rangeslider{
    margin: 10px;
}

Configuration

An object defining configuration options for the RangeSlider widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.