The Grid enables you to split its content into pages.
To enable paging:
- Set the pageable, pageSize, and skip options of the Grid.
- Handle the emitted pageChange event.
- Manually paginate the data.
The PagerSettings object has the following fields:
- buttonCount—Sets the maximum numeric buttons count before the buttons are collapsed. Defaults to
- info—Toggles the information about the current page and the total number of records. Defaults to
- pageSizes—Shows a menu for selecting the page size. Defaults to
- previousNext—Toggles the Previous and Next buttons. Defaults to
- type—Defines the type of the Grid pager.The available values are
'numeric'(buttons with numbers) and
'input'(input for typing the page number) values. Defaults to
- responsive—Toggles the built-in responsive behavior. Defaults to
5.0.0 the Grid pager features the same responsive functionality as the Pager component. The responsive Pager is enabled by default. To disable the responsive functionality, set the responsive property of the PagerSettings object to
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.
To further customize the pager appearance, use PagerTemplateDirective. It enables you to take full control over the content of the pager by mixing custom components and the built-in pager elements.
The Grid package exposes the following built-in Pager components:
- PagerInfoComponent - Shows information about the current page and the total number of records.
- PagerInputComponent - Displays an input element which allows typing and rendering of page numbers.
- PagerNextButtonsComponent - Buttons for navigating to the next and last page.
- PagerNumericButtonsComponent - Numeric buttons for navigation between the pages.
- PagerPageSizesComponent - Displays a drop-down list for the page size selection.
- PagerPrevButtonsComponent- Buttons for navigating to the first and previous page.
- GridSpacer - Provides additional white space between the pager inner elements.
The following example demonstrates how to define a pager template.
The GridSpacer enables you to define spacing between the pager inner elements and arrange them in accordance with your preference. By default each
kendo-grid-spacer element occupies all available space. To override this behavior and specify a custom size, you could utilize the width property.
The following example demonstrates how to position the numeric buttons at the center of the available Pager space.