Component Class
Description here
Copyright (c) 2016 ItsAsbreuk - http://itsasbreuk.nl
New BSD License - http://choosealicense.com/licenses/bsd-3-clause/
Item Index
Methods
changePageSize
-
newIndex
Will set the itemsPerPage, by calling the callback props.onChangePageSize.
Parameters:
-
newIndexNumberthe index of the array
this.props.pageSizesthat was selected
gotoPage
-
page -
blur -
e
Will reset the current page, by calling the callback props.onChange.
render
()
React render-method --> renderes the Component.
Returns:
ReactComponent
renderSelectSizes
()
Renders the select-sizes Select-Component.
Returns:
ReactComponent
Properties
itemsPerPage
Number
How many items are shown on a page. This value is needed to generate the pagebuttons. When not set, all items are supposed to be shown on a single page.
msgOneItem
String
The one-item-message of: showing 1 item.
Only available when showCountOutOf===true.
msgOutOf
String
The showing-message of: showing count out of total.
Only available when showCountOutOf===true.
msgShowing
String
The out of-message of: showing count out of total.
Only available when showCountOutOf===true.
msgShowingNoItems
String
The showing no items-message: the message when there are no items.
Only available when showCountOutOf===true.
onChange
Function
The callback whenever a page is changed. The callback gets 1 argument --> newPage, which is the pagenumber (starting at 1).
onChangePageSize
Function
The callback whenever a page is changed.
The callback get1 1 argument --> newIndex, which is the selected index within the property pageSizes.
pageSizes
Array
The pageSizes. In order to wotk well with onChangePageSize, it is recomended to fill this array with numbers.
In this case, the callback can pick up the number straight ahead and pass it into itemsPerPage at once.
totalItems
Number
The Total itemcount of the array where the paginator relates to. This number is used to calculate and generate the buttons.