All docs
V19.2
24.2
The page you are viewing does not exist in version 24.2.
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

JavaScript/jQuery ScrollView Options

An object defining configuration options for the ScrollView widget.

See Also

bounceEnabled

A Boolean value specifying whether to enable or disable the bounce-back effect.

Type:

Boolean

Default Value: true, false (desktop)

If the option is set to true, you can scroll the widget content up (down) even if you have reached the bottom (top) boundary. But when you release the content, it returns to the bound position. If the option value is false, you can scroll the widget content until you reach the boundary.

direction

A string value specifying the available scrolling directions.

Type:

String

Default Value: 'vertical'
Accepted Values: 'both' | 'horizontal' | 'vertical'

Use the ScrollDirection enum to specify this option when the widget is used as an ASP.NET MVC 5 Control or a DevExtreme-Based ASP.NET Core Control. This enum accepts the following values: Vertical, Horizontal and Both.

disabled

Specifies whether the widget responds to user interaction.

Type:

Boolean

Default Value: false

elementAttr

Specifies the attributes to be attached to the widget's root element.

Type:

Object

Default Value: {}

jQuery
$(function(){
    $("#scrollViewContainer").dxScrollView({
        // ...
        elementAttr: {
            id: "elementId",
            class: "class-name"
        }
    });
});
Angular
HTML
TypeScript
<dx-scroll-view ...
    [elementAttr]="{ id: 'elementId', class: 'class-name' }">
</dx-scroll-view>
import { DxScrollViewModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxScrollViewModule
    ],
    // ...
})
Vue
App.vue
<template>
    <DxScrollView ...
        :element-attr="scrollViewAttributes">
    </DxScrollView>
</template>

<script>
import DxScrollView from 'devextreme-vue/scroll-view';

export default {
    components: {
        DxScrollView
    },
    data() {
        return {
            scrollViewAttributes: {
                id: 'elementId',
                class: 'class-name'
            }
        }
    }
}
</script>
React
App.js
import React from 'react';

import ScrollView from 'devextreme-react/scroll-view';

class App extends React.Component {
    scrollViewAttributes = {
        id: 'elementId',
        class: 'class-name'
    }

    render() {
        return (
            <ScrollView ...
                elementAttr={this.scrollViewAttributes}>
            </ScrollView>
        );
    }
}
export default App;

height

Specifies the widget's height.

Type:

Number

|

String

|

Function

Return Value:

Number

|

String

The widget's height.

Default Value: undefined

This option accepts a value of one of the following types:

  • Number
    The height in pixels.

  • String
    A CSS-accepted measurement of height. For example, "55px", "80%", "inherit".

  • Function
    A function returning either of the above. For example:

    JavaScript
    height: function() {
        return window.innerHeight / 1.5;
    }

onDisposing

A function that is executed before the widget is disposed of.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

ScrollView

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

Model data. Available only if you use Knockout.

Default Value: null

onInitialized

A function used in JavaScript frameworks to save the widget instance.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

ScrollView

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

Default Value: null

See Also

onOptionChanged

A function that is executed after a widget option is changed.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
model

Object

Model data. Available only if you use Knockout.

fullName

String

The path to the modified option that includes all parent options.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

ScrollView

The widget's instance.

name

String

The modified option if it belongs to the first level. Otherwise, the first-level option it is nested into.

value any

The modified option's new value.

Default Value: null

onPullDown

A function that is executed when the "pull to refresh" gesture is performed. Supported in mobile themes only.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

ScrollView

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

Model data. Available only if Knockout is used.

Default Value: null

The function passed to this option should contain a call to the release() method, which releases the scroll view.

JavaScript
var scrollViewOptions = {
    onPullDown: function(options){
        . . .
        options.component.release();
    }
}

onReachBottom

A function that is executed when the content is scrolled down to the bottom.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

ScrollView

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

Model data. Available only if Knockout is used.

Default Value: null

The function passed to this option should contain a call to the release() method, which releases the scroll view.

JavaScript
var scrollViewOptions = {
    onReachBottom: function(options){
        . . .
        options.component.release();
    }
}

onScroll

A function that is executed on each scroll gesture.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

ScrollView

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is a dxEvent or a jQuery.Event when you use jQuery.

jQueryEvent

jQuery.Event

Use 'event' instead.

The jQuery event that caused the handler execution. Deprecated in favor of the event field.

model

Object

Model data. Available only if Knockout is used.

reachedBottom

Boolean

Indicates whether the container's bottom boundary is reached.

reachedLeft

Boolean

Indicates whether the container's left boundary is reached.

reachedRight

Boolean

Indicates whether the container's right boundary is reached.

reachedTop

Boolean

Indicates whether the container's top boundary is reached.

scrollOffset

Object

The current scroll offset in the following format: { top: topOffset, left: leftOffset }.

Default Value: null

onUpdated

A function that is executed each time the widget is updated.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

ScrollView

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

event

Event (jQuery or EventObject)

The event that caused the function to execute. It is a dxEvent or a jQuery.Event when you use jQuery.

jQueryEvent

jQuery.Event

Use 'event' instead.

The jQuery event that caused the handler execution. Deprecated in favor of the event field.

model

Object

Model data. Available only if Knockout is used.

reachedBottom

Boolean

Indicates whether the container's bottom boundary is reached.

reachedLeft

Boolean

Indicates whether the container's left boundary is reached.

reachedRight

Boolean

Indicates whether the container's right boundary is reached.

reachedTop

Boolean

Indicates whether the container's top boundary is reached.

scrollOffset

Object

The current scroll offset in the following format: { top: topOffset, left: leftOffset }.

Default Value: null

pulledDownText

Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold.

Type:

String

Default Value: 'Release to refresh...', '' (Material)

pullingDownText

Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold.

Type:

String

Default Value: 'Pull down to refresh...', '' (Material)

reachBottomText

Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom.

Type:

String

Default Value: 'Loading...', '' (Material)

refreshingText

Specifies the text shown in the pullDown panel displayed when the content is being refreshed.

Type:

String

Default Value: 'Refreshing...', '' (Material)

rtlEnabled

Switches the widget to a right-to-left representation.

Type:

Boolean

Default Value: false

When this option is set to true, the widget text flows from right to left, and the layout of elements is reversed. To switch the entire application/site to the right-to-left representation, assign true to the rtlEnabled field of the object passed to the DevExpress.config(config) method.

JavaScript
DevExpress.config({
    rtlEnabled: true
});
See Also

scrollByContent

A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. Applies only if useNative is false

Type:

Boolean

Default Value: true, false (non-touch devices)

scrollByThumb

A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar.

Type:

Boolean

Default Value: false, true (desktop)

showScrollbar

Specifies when the widget shows the scrollbar.

Type:

String

Default Value: 'onScroll', 'onHover' (desktop)
Accepted Values: 'onScroll' | 'onHover' | 'always' | 'never'

Setting this option makes sense only when the useNative option is set to false.

Use the ShowScrollbarMode enum to specify this option when the widget is used as an ASP.NET MVC 5 Control or a DevExtreme-Based ASP.NET Core Control. This enum accepts the following values: OnScroll, OnHover, Always, and Never.

useNative

Indicates whether to use native or simulated scrolling.

Type:

Boolean

Default Value: true, false (desktop), true (Mac)

width

Specifies the widget's width.

Type:

Number

|

String

|

Function

Return Value:

Number

|

String

The widget's width.

Default Value: undefined

This option accepts a value of one of the following types:

  • Number
    The width in pixels.

  • String
    A CSS-accepted measurement of width. For example, "55px", "80%", "auto", "inherit".

  • Function
    A function returning either of the above. For example:

    JavaScript
    width: function() {
        return window.innerWidth / 1.5;
    }