admin管理员组文章数量:1426928
I am using angular pagination in which if the page are too much then its showing pagination like google logic.
Here is the screenshot for the same
I want to restric the width of the pagination so i need to remove some extra numbers to show so is there any way to remove some pages like its showing 7 pages in start can i restrict it to 3 pages.
This is my plete code
Pagination HTML
<div class="paginationCont">
<dir-pagination-controls boundary-links="true" on-page-change="pageChangeHandler(newPageNumber)" template-url="templates/pagination_ctrls.html"></dir-pagination-controls>
</div>
Printing rows
<tr ng-hide="transStatus=='inactive'" dir-paginate="item in transactions | filter: transSearch | itemsPerPage: pageSize" current-page="currentPage">
<td><div class="checkbox"><label><input type="checkbox" ng-checked="allCheck"> {{item.txn_id}}</label></div></td>
<td>{{item.name}}</td>
<td>{{item.datetime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{item.amount}}</td>
<td>{{item.client_cut}}</td>
<td ng-switch="item.status"><span ng-switch-when="1">Active</span><span ng-switch-when="0">Inactive</span></td>
</tr>
I am using angular pagination in which if the page are too much then its showing pagination like google logic.
Here is the screenshot for the same
I want to restric the width of the pagination so i need to remove some extra numbers to show so is there any way to remove some pages like its showing 7 pages in start can i restrict it to 3 pages.
This is my plete code
Pagination HTML
<div class="paginationCont">
<dir-pagination-controls boundary-links="true" on-page-change="pageChangeHandler(newPageNumber)" template-url="templates/pagination_ctrls.html"></dir-pagination-controls>
</div>
Printing rows
<tr ng-hide="transStatus=='inactive'" dir-paginate="item in transactions | filter: transSearch | itemsPerPage: pageSize" current-page="currentPage">
<td><div class="checkbox"><label><input type="checkbox" ng-checked="allCheck"> {{item.txn_id}}</label></div></td>
<td>{{item.name}}</td>
<td>{{item.datetime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{item.amount}}</td>
<td>{{item.client_cut}}</td>
<td ng-switch="item.status"><span ng-switch-when="1">Active</span><span ng-switch-when="0">Inactive</span></td>
</tr>
Share
Improve this question
asked Oct 6, 2016 at 7:13
Gaurav AggarwalGaurav Aggarwal
10.2k8 gold badges41 silver badges76 bronze badges
1 Answer
Reset to default 3you can use . max-size (optional, default = 9) Specify a maximum number of pagination links to display. The default is 9, and the minimum is 5 (setting a lower value than 5 will not have an effect).
so your pagination html will be
<div class="paginationCont">
<dir-pagination-controls max-size="5" boundary-links="true" on-page-change="pageChangeHandler(newPageNumber)" template-url="templates/pagination_ctrls.html"></dir-pagination-controls>
</div>
after adding max-size="5" pagination will look like this
Hope this will help you.
本文标签: javascriptAngular pagination control page number to showStack Overflow
版权声明:本文标题:javascript - Angular pagination control page number to show - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745487269a2660437.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论