Constructor
Creates a new pagination component with default settings (page 1 of 1).
Properties
Returns the current page number property for binding.
The observable current page property (1-indexed)
Returns the total pages property for binding.
Methods
Sets the callback to execute when the page changes.
Usage Example
Behavior
- Displays page numbers with ellipsis (…) for large page ranges
- Shows up to 7 page buttons at a time
- Always displays first and last page
- Previous button is disabled on first page
- Next button is disabled on last page
- Active page is highlighted
Page Number Display Logic
- 7 or fewer pages: Shows all page numbers
- More than 7 pages: Shows first page, current page ± 1, last page, with ellipsis between ranges
Style Classes
.j-pagination- Main container.j-pagination-btn- Page button.active- Active page button.disabled- Disabled button (ellipsis)