You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using dirPagination is there a way to count the results that are currently shown on the page and also get the complete number of results.
I know I can use array.length to get the complete number of results, but I can't do anything to get the total results on that page other than using the property value of the total items per page which doesn't always match the results on that page.
If I've not explained it enough I'm trying to do a Displaying 1-20 of 150 but then there is only 1-7 of 7. I can't do that.
Bare in mind I've seen the documentation of the dir-pagination-controls but it doesn't work with the layout of my page.
You could accomplish this with some simple math with the variables you already have. As this is not a code issue and the author no longer maintains this software, if this solution works for you please close this issue so they are not burdened with open issues. You should find this an acceptable starting point, although will need to implement it as needed to work in your view:
Let's say say resultsOnPage is the var you want to store the results in.
Multiply the itemsPerPage by currentPage, and check if the array.length is more than or equal to this. If it is, then resultsOnPage would be equal to itemsPerPage. If it's less than it, subtract that number from array.length, and that will be the remaining number on that last page (or first page if the total results don't populate a whole page).
When using dirPagination is there a way to count the results that are currently shown on the page and also get the complete number of results.
I know I can use
array.length
to get the complete number of results, but I can't do anything to get the total results on that page other than using the property value of the total items per page which doesn't always match the results on that page.If I've not explained it enough I'm trying to do a Displaying 1-20 of 150 but then there is only 1-7 of 7. I can't do that.
Bare in mind I've seen the documentation of the dir-pagination-controls but it doesn't work with the layout of my page.
Code:
<tr dir-paginate="lead in filteredLeads = (Leads | filter: leadSearchKeyword | filter: leadsFilter | filter: dateFilter) | itemsPerPage: 20" ng-class="(lead.refundStatus == 'none' ? 'active' :(lead.refundStatus == 0 ? 'pending' : (lead.refundStatus == 1 ? 'declined' : 'active')))" current-page="currentPage">1</tr>
The text was updated successfully, but these errors were encountered: