indexPages()

Makes an array of objects representing the pagination details based on the current page number, the number of pages and the maximum number of pages to show.

This function is valid in v2.24.0 to v2.24.2. This function has been downloaded 8 times.

Parameters

{number} pageNumber
The page number to be selected.
{number} pageCount
The total number of pages.
{number=} opt_length Optional, Default:5
The number of pages to index. This will be the maximum number of array objects returned.

Returns

{Array}
Array of objects representing pages. Each object will contain number (the page number), isSelected (a boolean indicating if the page is pageNumber), and isBoundary (a boolean indicating if number is pageNumber or pageCount).

Requiring Function

This function is directly required by the following function:

  • paginate()
    Makes an array of objects by grouping the array values by page. Similar to indexPages() but includes the items property in each object.