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

Scroll Modes

The native Vue Grid by Kendo UI enables you to configure its layout modes.

You can set the following modes to the Grid:

Scrollable

When scrolling is enabled, the content of the Grid is rendered as tables—one for the header area, another one for the scrollable data area, and a third one for the footer area. This behavior ensures that the header and footer areas of the Grid are always visible while the user scrolls vertically. The scrollable mode is enabled by default. To configure it, use the scrollable option, which also requires you to set the height of the Grid through its style property.

Conditional Scrolling

By configuring the style.maxHeight property, you can set the Grid in scrollable mode only when its rendered content exceeds certain height limits. If the content does not exceed the set maximum height, the height of the Grid will be the same as the height of its content.

Non-Scrollable

When the non-scrollable mode is enabled, the Grid renders its data as a single table and the scrollbar is not displayed. To configure the non-scrollable mode, set scrollable to none.

Virtual Scrolling

Virtual scrolling provides an alternative to paging. While the user is scrolling the table, the Grid requests and displays only the visible pages.

Setup

To set up the Grid for virtual scrolling:

  1. Set its height either through its style property.
  2. Set the regular or detail row height and the number of records.
  3. Provide the data for each page through the onPageChange event handler.

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

  • (Required) scrollable—Set it to virtual.
  • (Required) height through style
  • (Required) skip
  • (Required) total
  • (Required) pageSize—To avoid unexpected behavior during scrolling, set pageSize to at least 1.5 * the number of the visible Grid elements. The number of the visible Grid elements is determined by the height and rowHeight settings of the Grid.
  • (Required) data
  • (Optional) rowHeight
Example
View Source
Change Theme:

Debouncing pageChange Events

When configured for virtualization, the Grid fires the onPageChange event as often as possible. This behavior allows for a smoother scrolling experience when the data is available in memory.

If the data is requested from a remote service, debounce or otherwise limit the page changes.

Example
View Source
Change Theme:

Infinite Scrolling

After the user scrolls to the end of the page, the Grid enables you to load more records by appending additional pages of data on demand. To implement the infinite scrolling feature, use the scroll event and add more data once the user is near to the bottom of the Grid.

The following example demonstrates how to dynamically add data to the Grid while the user is scrolling.

Example
View Source
Change Theme: