All docs
V24.2
24.2
24.1
23.2
23.1
22.2
22.1
21.2
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2.
19.1
The page you are viewing does not exist in version 19.1.
18.2
The page you are viewing does not exist in version 18.2.
18.1
The page you are viewing does not exist in version 18.1.
17.2
The page you are viewing does not exist in version 17.2.

JavaScript/jQuery TreeList - Scrolling

Scrolling enables a user to browse data that lies outside the UI component's viewport. The following scrolling modes are available in the TreeList:

  • Standard
    Loads all rows simultaneously.

  • Virtual
    Rows are loaded when they get into the viewport and removed once they leave it. Use this mode if a user should be able to scroll data jumping swiftly from one row to another. Scrolling in this mode becomes smoother if the UI component preloads the adjacent pages. You can enable this feature by setting the scrolling.preloadEnabled property to true, but note that it may cause lags on low-performing devices.

Use the scrolling.mode property to specify the current scrolling mode.

jQuery
JavaScript
$(function() {
    $("#treeListContainer").dxTreeList({
        scrolling: {
            mode: "standard" // or "virtual"
        }
    });
});
Angular
HTML
TypeScript
<dx-tree-list ... >
    <dxo-scrolling
        mode="standard"> <!-- or "virtual" -->
    </dxo-scrolling>
</dx-tree-list>
import { DxTreeListModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxTreeListModule
    ],
    // ...
})
Vue
App.vue
<template>
    <DxTreeList ... >
        <DxScrolling mode="standard" /> <!-- or "virtual" | "infinite" -->
    </DxTreeList>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxTreeList, {
    DxScrolling
} from 'devextreme-vue/tree-list';

export default {
    components: {
        DxTreeList,
        DxScrolling
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import TreeList, {
    Scrolling
} from 'devextreme-react/tree-list';

class App extends React.Component {
    render() {
        return (
            <TreeList ... >
                <Scrolling mode="standard" /> {/* or "virtual" | "infinite" */}
            </TreeList>
        );
    }
}
export default App;

The TreeList adapts its scrolling mechanism to the current platform. It utilizes native scrolling on most platforms, except non-Mac desktops, where the UI component simulates scrolling. You can force the TreeList to use native or simulated scrolling on all platforms by setting the useNative property.

jQuery
JavaScript
$(function() {
    $("#treeListContainer").dxTreeList({
        scrolling: {
            useNative: true
        }
    });
});
Angular
HTML
TypeScript
<dx-tree-list ... >
    <dxo-scrolling
        [useNative]="true">
    </dxo-scrolling>
</dx-tree-list>
import { DxTreeListModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxTreeListModule
    ],
    // ...
})
Vue
App.vue
<template>
    <DxTreeList ... >
        <DxScrolling
            :use-native="true"
        />
    </DxTreeList>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxTreeList, {
    DxScrolling
} from 'devextreme-vue/tree-list';

export default {
    components: {
        DxTreeList,
        DxScrolling
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import TreeList, {
    Scrolling
} from 'devextreme-react/tree-list';

class App extends React.Component {
    render() {
        return (
            <TreeList ... >
                <Scrolling
                    useNative={true}
                />
            </TreeList>
        );
    }
}
export default App;

The current platform determines the native scrolling settings and you cannot adjust them, but you can control the simulated scrolling. Particularly, you can specify whether a user scrolls the content with a swipe gesture or the scrollbar by setting the scrollByContent and scrollByThumb properties. Also, set the showScrollbar property to specify when the scrollbar should appear.

jQuery
JavaScript
$(function() {
    $("#treeListContainer").dxTreeList({
        scrolling: {
            useNative: false,
            scrollByContent: true,
            scrollByThumb: true,
            showScrollbar: "onHover" // or "onScroll" | "always" | "never"
        }
    });
});
Angular
HTML
TypeScript
<dx-tree-list ... >
    <dxo-scrolling
        [useNative]="false"
        [scrollByContent]="true"
        [scrollByThumb]="true"
        showScrollbar="onHover"> <!-- or "onScroll" | "always" | "never" -->
    </dxo-scrolling>
</dx-tree-list>
import { DxTreeListModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxTreeListModule
    ],
    // ...
})
Vue
App.vue
<template>
    <DxTreeList ... >
        <DxScrolling
            :use-native="false"
            :scroll-by-content="true"
            :scroll-by-thumb="true"
            show-scrollbar="onHover" /> <!-- or "onScroll" | "always" | "never" -->
    </DxTreeList>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxTreeList, {
    DxScrolling
} from 'devextreme-vue/tree-list';

export default {
    components: {
        DxTreeList,
        DxScrolling
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import TreeList, {
    Scrolling
} from 'devextreme-react/tree-list';

class App extends React.Component {
    render() {
        return (
            <TreeList ... >
                <Scrolling
                    useNative={false}
                    scrollByContent={true}
                    scrollByThumb={true}
                    showScrollbar="onHover" /> {/* or "onScroll" | "always" | "never" */}
            </TreeList>
        );
    }
}
export default App;
See Also