DevExtreme Angular - Scrolling
Scrolling enables a user to browse data that lies outside the widget'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 widget preloads the adjacent pages. You can enable this feature by setting the scrolling.preloadEnabled option to true, but note that it may cause lags on low-performing devices.
Use the scrolling.mode option to specify the current scrolling mode.
jQuery
$(function() { $("#treeListContainer").dxTreeList({ scrolling: { mode: "standard" // or "virtual" } }); });
Angular
<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 ], // ... })
The TreeList adapts its scrolling mechanism to the current platform. It utilizes native scrolling on most platforms, except non-Mac desktops and Android 4.0 below devices, where the widget simulates scrolling. You can force the TreeList to use native or simulated scrolling on all platforms by setting the useNative option.
jQuery
$(function() { $("#treeListContainer").dxTreeList({ scrolling: { useNative: true } }); });
Angular
<dx-tree-list ... > <dxo-scrolling [useNative]="true"> </dxo-scrolling> </dx-tree-list>
import { DxTreeListModule } from "devextreme-angular"; // ... export class AppComponent { // ... } @NgModule({ imports: [ // ... DxTreeListModule ], // ... })
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 options. Also, set the showScrollbar option to specify when the scrollbar should appear.
jQuery
$(function() { $("#treeListContainer").dxTreeList({ scrolling: { useNative: false, scrollByContent: true, scrollByThumb: true, showScrollbar: "onHover" // or "onScroll" | "always" | "never" } }); });
Angular
<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 ], // ... })
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.