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

Paging

The TreeList enables you to split its content into pages.

Getting Started

To enable paging:

  1. Set the pageable attribute to true.
  2. Set the desired pageSize value.
Example
View Source
Change Theme:

Pager Settings

To configure the TreeList pager, pass the PagerSettings object to the pageable option of the TreeList.

The PagerSettings object has the following fields:

  • buttonCount—Sets the maximum numeric buttons count before the buttons are collapsed. Defaults to 10.
  • countChildren—Indicates if child nodes should be fetched and counted for the pager total. By default, the TreeList will fetch all children when paging is enabled. Set this option to false to disable this behavior.
  • info—Toggles the information about the current page and the total number of records. Defaults to true.
  • pageSizes—Shows a menu for selecting the page size. Defaults to false.
  • previousNext—Toggles the Previous and Next buttons. Defaults to true.
  • type—Defines the type of the TreeList pager. The available values are 'numeric' (buttons with numbers) and 'input' (input for typing the page number) values. Defaults to 'numeric'.
  • responsive—Toggles the built-in responsive behavior. Defaults to true.
Example
View Source
Change Theme:

Responsive Pager

Since version 3.0.0 the TreeList pager features the same responsive functionality as the Pager component. The responsive Pager is enabled by default. To disable the responsive functionality, set the PagerSettings object to false.

When the Pager template is used, the default responsive behavior is disabled, as the developer has full control over the Pager content.

The following example demonstrates the responsive Pager in action.

Example
View Source
Change Theme:

Pager Template

To further customize the pager appearance, use PagerTemplateDirective. The option enables you to take full control over the content of the pager item by mixing custom components and the built-in pager elements.

The TreeList package exposes the following built-in Pager components:

The following example demonstrates how to define a pager template.

Example
View Source
Change Theme:

Define Spacing between the Pager Elements

The TreeListSpacer enables you to define spacing between the pager inner elements and arrange them in accordance with your preference. By default, each width property.

The following example demonstrates how to position the numeric buttons at the center of the available Pager space.

Example
View Source
Change Theme: