【问题标题】:Paginate with Angularjs filter使用 Angularjs 过滤器进行分页
【发布时间】:2016-09-30 15:45:58
【问题描述】:

我一直在将 Angularjs 用于动态表,我应用了过滤器和分页(UI Bootstrap Pagination),过滤器工作正常,但我过滤了分页页面上每个页面上的数据。分页没有更新

<tr class="instances" ng-repeat="instance in fail_instances.slice(((currentPage_fail-1)*itemsPerPage), ((currentPage_fail)*itemsPerPage)) | filter:searchText">

分页:

<pagination total-items="totalItems_pass" ng-model="currentPage_pass" max-size="maxSize" class="pagination-sm" boundary-links="true" rotate="false" num-pages="numPages" items-per-page="itemsPerPage"></pagination>

【问题讨论】:

  • 请提供minimal reproducible example以及简明正确的问题描述以及预期行为
  • 该分页使用与 ng-repeat 不同的模型
  • 没有修复
  • 修复什么...您没有解释预期行为或解释分页和 ng-repeat 之间的不匹配或更新问题

标签: javascript jquery angularjs twitter-bootstrap pagination


【解决方案1】:

我建议您使用 dirPagination,因为它非常灵活,并且还会根据过滤条件动态更新数据页面。

试试这个链接:-- //plnkr.co/edit/Wtkv71LIqUR4OhzhgpqL?p=preview

检查是否是您需要的。

【讨论】:

    猜你喜欢
    • 2017-03-17
    • 2019-07-22
    • 1970-01-01
    • 2014-08-09
    • 1970-01-01
    • 2021-10-19
    • 2020-10-05
    • 2016-07-01
    • 2018-12-25
    相关资源
    最近更新 更多