分页指令多次在同一页面上

时间:2016-01-23 09:54:42

标签: jquery angularjs

我正在使用angular创建一个Web应用程序。我用角度js创建了一个网格。我想在类似的页面上使用两次分页指令。但是当我先点击时问题就出现了。

这是我的代码:

  <div dir-paginate="partners in partnersData|orderBy:orderByField:reverseSort |filter:{name: partners.name, website: partners.website, location: partners.location}|itemsPerPage: limits as filteredArray" current-page="currentPage">
          <div class="rowDiv">
            <div class="cellDiv"><span   ng-click="makeFavourite(partners)" class="star_rating hide" ng-class="{'select':partners.select}"></span> <span ng-click="showImage($index)"></span></div>
            <div class="cellDiv" ng-click="showName($index)">{{partners.name}}</div>
            <div class="cellDiv" ng-click="openWebsite(partners.website)">{{partners.website}}</div>
            <div class="cellDiv">{{partners.location}}</div>
            <div class="cellDiv">{{partners.service}}</div>
            <div class="cellDiv">{{partners.connection}}</div>
            <div class="cellDiv">{{partners.action}}</div>
            <div class="cellDiv lastCell"><span class="icon_pluse" ng-click="openPlus($index)"></span><span class="icon_info" ng-click="openInfo($index)"></span></div>
          </div>
<dir-pagination-controls boundary-links="true"  template-url="templates/dashboard/dirPagination.tpl.html"></dir-pagination-controls>


<tr dir-paginate="informationData in information| itemsPerPage: pageSize" current-page="currentPage">
                  <td>{{informationData.status}}</td>
                  <td>{{informationData.endpoint}}</td>
                  <td>{{informationData.partnerEndPoint}}</td>
                  <td>{{informationData.location}}</td>
                  <td>{{informationData.bandwidth}}</td>
                  <td>{{informationData.initiated}}</td>
                  <td>{{informationData.provisioned}}</td>
                  <td>{{informationData.Deleted}}</td>
                </tr>

1 个答案:

答案 0 :(得分:0)

分页指令在这里: https://github.com/michaelbromley/angularUtils/issues/128

要多次分配分页,您必须提供分页ID:

<tr dir-paginate="informationData in information| itemsPerPage: pageSize" pagination-id="abc"current-page="currentPage">
<dir-pagination-controls boundary-links="true"  template-url="templates/dashboard/dirPagination.tpl.html" pagination-id="abc"></dir-pagination-controls>