Pager (Insight Engine)
Pager (Insight Engine)
|
Note
This component was introduced in version |
The Pager
controller allows to navigate through the different result pages.
Methods
isCurrentPage
Returns true
when the current page is equal to the passed page, and false
otherwise.
Parameters
-
page:
number
The page number to check.
Returns boolean
: Whether the passed page is selected.
selectPage
Updates the results to those on the passed page.
Parameters
-
page:
number
The page number.
subscribe
Adds a callback that’s invoked on state change.
Parameters
-
listener:
() => void
A callback that’s invoked on state change.
Returns Unsubscribe
: A function to remove the listener.
Attributes
state
The state of the Pager controller.
Properties
-
currentPage:
number
The active page number.
-
currentPages:
number[]
The page range to display.
-
hasNextPage:
boolean
Returns
true
when a next page is available, andfalse
otherwise. -
hasPreviousPage:
boolean
Returns
true
when a previous page is available, andfalse
otherwise. -
maxPage:
number
The maximum available page.
Initialize
buildPager
Creates an insight Pager
controller instance.
Parameters
-
engine:
InsightEngine
The insight engine.
-
props:
PagerProps
The configurable
Pager
properties.
Returns Pager
PagerProps
The configurable Pager
properties.
Properties
-
initialState?:
PagerInitialState
The initial state that should be applied to the
Pager
controller. -
options?:
PagerOptions
The options for the
Pager
controller.