-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search filter for all pages not working in Angular 8. #368
Comments
Hi. Please fill out the issue template: Angular version: ngx-pagination version: Description of issue: Steps to reproduce: Expected result: Actual result: Demo: (if possible, edit this StackBlitz demo and paste the link to your fork) Any relevant code:
|
Angular version: 9.0.7 ngx-pagination version:5.0.0 Description of issue: I have used ng2 search filter and ngx pagination but still I'm able to search within the pages and not in all pages. I am able to search the data of first page in first page only. The data of second page in second page only. But I'm not able to search the data of one page into another. If I do it the page comes empty. Steps to reproduce: HTML Code: <tr *ngFor ="let game of games| filter :term| paginate: {itemsPerPage:5, currentPage:p}; let i = index" >
<td>{{game.name}}</td>
<td>{{game.genre}}</td>
</tr>
</tbody>
</table>
<pagination-controls directionLinks="true" (pageChange)="p = $event"></pagination-controls> Expected result: I want the search to happen in all pages. Like if I search the data of first page from the third page then also the output should come. Instead of coming empty. Actual result: The data of first page gets searched in the first only. The data of second page gets searched in the second only. And respectively for every page. Demo: (if possible, edit this StackBlitz demo and paste the link to your fork) Any relevant code: <tr *ngFor ="let game of games| filter :term| paginate: {itemsPerPage:5, currentPage:p}; let i = index" >
<td>{{game.name}}</td>
<td>{{game.genre}}</td>
</tr>
</tbody>
</table>
<pagination-controls directionLinks="true" (pageChange)="p = $event"></pagination-controls> |
This comment has been minimized.
This comment has been minimized.
Thanks for the info. By the way - if you want to show code, surround it in 3 back-ticks:
Since I don't know about the ng2 search filter library, I cannot know what exactly it does or how it interacts with this library to cause the issue. If you can reproduce the behaviour using this Stackblitz demo as the basis, then I can investigate further. |
What have you done next? |
Anyone find the solution? |
The ng2 search filter didn't work fine for me. So instead I used filter keyword on the array to fetch the search item. |
Thank you @shivangi53 |
Anyone find the solution about ng2SearchFilter ? |
I'm not sure how this will help, but I managed to solve the issue by placing my filter pipe before my pagination pipe like the below example: - | filter :searchValue | paginate: { hope this helps its been buggin me for a while to be honest. |
Use totalItems: datasource.length in pagination |
I am having the same issue. I have used ng2 search filter and ngx pagination in my HTML file of angular project. I am able to search within pages but not all pages. I have even put the filter first and then paginate but it's still not working. Can you please help me out of this?
Originally posted by @shivangi53 in #178 (comment)
The text was updated successfully, but these errors were encountered: