6

Am using dir-pagination directive for pagination, its working fine but while filtering pagination not getting update

Error-Dir-Pagination

Below is mycode:

     <tbody dir-paginate="booking in bookinglist | itemsPerPage: 30 | orderBy:sortKey:reverse">
        <tr ng-repeat="orders in booking.order | filter: booking_filter | dateRange: startDate : endDate | orderBy:sortKey:reverse">
          <td>{{booking.customer_name}}</td>
          <td>{{orders.order_id}}</td>
          <td>{{orders.service_name}}</td>
          <td>{{orders.employee_name}}</td>
          <td>{{orders.area_name}}</td>
          <td>{{orders.booking_date | date:"dd/MM/yyyy"}}</td>
          <td>{{orders.booking_time}}</td>
          <td>{{orders.status}}</td>
          <td class="g-btn-full-width">
            <button type="button" ng-click="EditBooking(orders._id)" class="btn btn-primary"><span class="fa fa-pencil"></span></button>
            <button type="button" ng-click="DeleteBooking(orders._id)" class="btn btn-danger"><span class="fa fa-trash"></span></button>
            <button type="button" ng-click="InvoiceGenerate(orders._id)" class="btn btn-warning">Invoice</button>
          </td>
        </tr>
      </tbody>
    </table>
    <dir-pagination-controls>
        max-size="5"
        direction-links="true"
        boundary-links="true"
    </dir-pagination-controls>
    </div>

am stuck with this...Help will be really appreciated

6
  • So when you switch pages the results don't get updated? Commented May 12, 2016 at 8:59
  • while filtering...based on filter result pagination not getting update Commented May 12, 2016 at 17:10
  • Don't think this is the issue, but your <dir-pagination-controls> html is closed off so that the attributes are children of the element rather than defined on the element. They probably aren't necessary for the directive to render correctly, but worth cleaning up just to make sure. Commented May 15, 2016 at 0:48
  • @Nodemon Could you share the booking_filter function? Commented May 17, 2016 at 16:36
  • How is loaded your bookingList ? Asynchronously ? The whole inthe same time or by page ? Commented May 18, 2016 at 7:14

2 Answers 2

1

You have to use filter: booking_filter in your tag where you have put dir-paginate

<tbody dir-paginate="booking in bookinglist | filter: booking_filter | itemsPerPage: 30 | orderBy:sortKey:reverse">
Sign up to request clarification or add additional context in comments.

1 Comment

I was about to answer the same! Hopefully you get the bounty before it expires
0

Update you booking list object inside your filter function . Since its two way data binding updating the booking list object might recalculate the filtered pagination.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.