forked from angular-ui/bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pagination):
total-items
& optional items-per-page
API
Closes angular-ui#820. BREAKING CHANGE: API has undergone some changes in order to be easier to use. * `current-page` is replaced from `page`. * Number of pages is not defined by `num-pages`, but from `total-items` & `items-per-page` instead. If `items-per-page` is missing, default is 10. * `num-pages` still exists but is just readonly. Before: <pagination num-pages="10" ...></pagination> After: <pagination total-items="100" ...></pagination>
- Loading branch information
1 parent
9af6f96
commit e55d906
Showing
6 changed files
with
670 additions
and
688 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
<div ng-controller="PaginationDemoCtrl" class="well well-small"> | ||
<h4>Default</h4> | ||
|
||
<pagination num-pages="noOfPages" current-page="currentPage"></pagination> | ||
<pagination boundary-links="true" num-pages="noOfPages" current-page="currentPage" class="pagination-small" previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination> | ||
<pagination direction-links="false" boundary-links="true" num-pages="noOfPages" current-page="currentPage"></pagination> | ||
<pagination direction-links="false" num-pages="noOfPages" current-page="currentPage"></pagination> | ||
<pagination total-items="totalItems" page="currentPage"></pagination> | ||
<pagination boundary-links="true" total-items="totalItems" page="currentPage" class="pagination-small" previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination> | ||
<pagination direction-links="false" boundary-links="true" total-items="totalItems" page="currentPage"></pagination> | ||
<pagination direction-links="false" total-items="totalItems" page="currentPage" num-pages="smallnumPages"></pagination> | ||
|
||
<button class="btn" ng-click="setPage(3)">Set current page to: 3</button> | ||
The selected page no: {{currentPage}} | ||
|
||
<hr /> | ||
<h4>Pager</h4> | ||
<pager num-pages="noOfPages" current-page="currentPage"></pager> | ||
<pager total-items="totalItems" page="currentPage"></pager> | ||
|
||
<hr /> | ||
<h4>Limit the maximimum visible page-buttons</h4> | ||
<pagination num-pages="bigNoOfPages" current-page="bigCurrentPage" max-size="maxSize" class="pagination-small" boundary-links="true"></pagination> | ||
<pagination rotate="false" num-pages="bigNoOfPages" current-page="bigCurrentPage" max-size="maxSize" class="pagination-small" boundary-links="true"></pagination> | ||
<h4>Limit the maximimum visible buttons</h4> | ||
<pagination total-items="bigTotalItems" page="bigCurrentPage" max-size="maxSize" class="pagination-small" boundary-links="true"></pagination> | ||
<pagination total-items="bigTotalItems" page="bigCurrentPage" max-size="maxSize" class="pagination-small" boundary-links="true" rotate="false" num-pages="numPages"></pagination> | ||
|
||
<pre>Page: {{bigCurrentPage}} / {{numPages}}</pre> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
var PaginationDemoCtrl = function ($scope) { | ||
$scope.noOfPages = 7; | ||
$scope.totalItems = 64; | ||
$scope.currentPage = 4; | ||
$scope.maxSize = 5; | ||
|
||
$scope.setPage = function (pageNo) { | ||
$scope.currentPage = pageNo; | ||
}; | ||
|
||
$scope.bigNoOfPages = 18; | ||
$scope.bigTotalItems = 175; | ||
$scope.bigCurrentPage = 1; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.