Grid - Paging HTML UI Elements for Mobile & Web Applications | www.HtmlElements.com

Grid Paging

Pagination can be enabled in Smart.Grid in order to view large data sets page by page and navigate through them easily.

Pagination is configured via two properties/objects: paging and pager.

To enable paging, set paging.enabled to true.

The number of Grid rows per page can be set via paging.pageSize. The default number is 10. The current page index can be get or set by accessing paging.pageIndex.

Once pages are set up, they can be navigated in two ways:


More information: property paging in the Grid API documentation.

Pager

Pager is a user interface component that allows for easy navigation of Grid pages and customization of paging settings. The pager part of Smart.Grid is an instance of Smart.Pager (<smart-pager>)

To enable the pager, set pager.visible to true.


Parts of the pager:

  1. Navigation buttons
  2. Page index selectors
  3. Auto ellipsis
  4. Navigation input
  5. Page size selector
  6. Summary

Additional settings of the pager object that control these parts are:

  • autoEllipsis - sets the ellipsis display mode.
  • position - sets the position of pager - 'near' (above rows), 'far' (below rows), or 'both'.
  • template - sets a template for the pager.
  • pageSizeSelector - describes the settings for the 'rows per page' option.
  • summary - describes the summary settings.
  • navigationButtons - describes the navigation buttons settings.
  • navigationInput - describes the settings about navigation input option.
  • pageIndexSelectors - describes the settings for the numeric page buttons.

More information: property pager in the Grid API documentation.

Spinner

An alternative to the pager is the spinner, which can be enabled by setting paging.spinner.enabled to true. The spinner appears as a pair of arrows above the Grid's scrollbar. Pressing the arrows navigates through Grid pages.

The property paging.spinner.step determines the number of pages to navigate via the spinner.