Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dir-pagination directive angularjs : Update pagination after filtering

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

like image 946
Nodemon Avatar asked May 09 '16 09:05

Nodemon


1 Answers

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">
like image 88
Pravesh Khatri Avatar answered Oct 23 '22 06:10

Pravesh Khatri