New to Kendo UI for Angular? Start a free 30-day trial

Virtual Scrolling

Virtual scrolling provides an alternative to paging.

While the user is scrolling the table, the TreeList renders only the rows for the current page depending on scroll position. To define the virtual scrolling functionality, set scrollable to virtual.

To determine when a pageChange event is fired so that the TreeList obtains and displays the next or the previous portion (page) of data items, the virtual scrolling functionality of the TreeList relies on calculations that are based on the fixed and equal rowHeight of the rows, the set pageSize of the Treelist, and the scrollTop position of the scrollable data table container.

Getting Started

To configure the TreeList for virtual scrolling:

  1. Set its height either through its height input or through the style property.
  2. Set the row height.

To work properly, virtual scrolling requires you to set the following configuration options:

  • (Required) scrollable—Set it to virtual.
  • (Required) height
  • (Required) rowHeight—Has to represent the actual height of each TreeList row (tr) element in the DOM. The provided rowHeight number is used for internal calculations and does not set the row height of the TreeList.
  • (Required) pageSize—To avoid unexpected behavior during scrolling, set pageSize to at least three times the number of the visible TreeList elements. The number of the visible TreeList elements is determined by the height and rowHeight settings of the TreeList.
  • (Required) data

Virtualization with Local Data

The following example demonstrates the virtualization of local data.

Example
View Source
Change Theme:

Virtualization with Remote Data

The following example demonstrates the virtualization of remote data.

Example
View Source
Change Theme:

Virtualization with Aggregates

You can use virtual scrolling in combination with aggregates by utilizing the kendoTreeListFlatBinding or kendoTreeListHierarchyBinding directive. The directives support only the processing of in-memory data and you have to provide the full set of data that will be processed.

The following example demonstrates the virtualization of aggregated hierarchical data.

Example
View Source
Change Theme:

Virtualization with Responsive Columns

The virtual scrolling functionality requires that all TreeList rows have an equal, predefined height. However, you can still keep virtual scrolling and use responsive columns which have different cell templates based on the column width.

Example
View Source
Change Theme:

Known Limitations

The TreeList's virtual scrolling may be affected by browser-specific limitations in terms of the maximum height of the container element. Values higher than the browser's limit cannot ensure reliable vertical scrolling and the scrollbar's thumb may seem immovable.