UI Widgets ScrollView

A widget used to display scrollable content.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/scroll_view

The ScrollView widget represents a scrollable field that displays data located inside the HTML element representing the widget.

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

  • jQuery
    Use the dxScrollView jQuery plug-in.

    HTML
    <div id="scrollView">
        . . .
    </div>
    JavaScript
    $("#scrollView").dxScrollView({
        direction: 'both',
        onPullDown: function() {
            //process pullDown event
        },
        onReachBottom: function() {
            //process reachBottom event
        }
    });
  • Knockout
    Add a div element and apply the dxScrollView binding to this element.

    HTML
    <div data-bind="dxScrollView: {
        direction: 'both',
        onPullDown: function() {
            //process pullDown event
        },
        onReachBottom: function() {
            //process reachBottom event
        }
    }">
        . . .
    </div>
  • AngularJS
    Add a div element and apply the dx-scroll-view directive to this element.

    HTML
    <div dx-scroll-view="{
        direction: 'both',
        onPullDown: function() {
            //process pullDown event
        },
        onReachBottom: function() {
            //process reachBottom event
        }
    }">
        . . .
    </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 detailed information on the principles of working with the widget in the dxScrollView section of the Individual Widgets article.

View Demo

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController" style="height:100%;">
    <div id="myScrollView" dx-scroll-view="{}">
        <div id="textContainer"></div>
    </div>
</div>
$.ajax({
    type: "POST",
    url: "/LoremService.asmx/LoremIpsum",
    data: JSON.stringify({ count: Math.ceil(Math.random() * 30) }),
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data) {
        $.each(data.d, function (index, value) {
            $("#textContainer").append("<p>" + value + "</p>");
        });
    }
});
var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function () { });
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
p{
    padding: 5px 10px;
    margin: 0;
}
.content{
    height: 100%;
}
<div id="myScrollView" data-bind="dxScrollView: { }">
    <div id="textContainer"></div>
</div>
$.ajax({
    type: "POST",
    url: "/LoremService.asmx/LoremIpsum",
    data: JSON.stringify({ count: Math.ceil(Math.random() * 30) }),
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data) {
        $.each(data.d, function (index, value) {
            $("#textContainer").append("<p>" + value + "</p>");
        });
    }
});
ko.applyBindings();
p{
    padding: 5px 10px;
    margin: 0;
}
.content{
    height: 100%;
}
<div id="myScrollView">
    <div id="textContainer"></div>
</div>
$.ajax({
    type: "POST",
    url: "/LoremService.asmx/LoremIpsum",
    data: JSON.stringify({ count: Math.ceil(Math.random() * 30) }),
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data) {
        $.each(data.d, function (index, value) {
            $("#textContainer").append("<p>" + value + "</p>");
        });
    }
});
$("#myScrollView").dxScrollView();
p{
    padding: 5px 10px;
    margin: 0;
}
.content{
    height: 100%;
}

Configuration

An object defining configuration options for the ScrollView widget.

Methods

This section describes the members used to manipulate the widget.

Events

This section describes events fired by this widget.