michaelbromley / ngx-pagination

Pagination for Angular
http://michaelbromley.github.io/ngx-pagination/
MIT License
1.21k stars 243 forks source link

pagination control "next" is visble after page gets loaded even if there is no data present in tha table. #355

Open ajinkyabapat1 opened 4 years ago

ajinkyabapat1 commented 4 years ago

Angular version: 7.2.15

ngx-pagination version:^3.2.1

Description of issue:

Pagination control "next " iss visble after the page gets loaded and even if there is no data presnt in table.

Steps to reproduce:

Expected result: next contol should be hidden similar to previous after page gets loaded for the first time. and if no data avaliable

Actual result: next control is visble after the application loaded for the first time <pagination-controls id="listing_pagination" maxSize="" directionLinks="true" (pageChange)="page = $event" [autoHide]="false"

<tr *ngFor=" let file of fileRecord | paginate : { id: 'listing_pagination', itemsPerPage: rowsOnPage, currentPage: page, totalItems: pagelength } | filter: searchText "

Demo: (if possible, edit this StackBlitz demo and paste the link to your fork)

image

here after clciking on search i am getting data , but pagination "next" contol is visble before fetching the data in the table Any relevant code:

michaelbromley commented 4 years ago

Hi, can you make a StackBlitz reproduction please? https://stackblitz.com/edit/angular-e1f9hq

ajinkyabapat1 commented 4 years ago

No it is not possible to create stackblitz project, because it's my private organisation project. But I have explained the issue ,I guess

On Thu, Apr 9, 2020, 7:35 PM Michael Bromley notifications@github.com wrote:

Hi, can you make a StackBlitz reproduction please? https://stackblitz.com/edit/angular-e1f9hq

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/michaelbromley/ngx-pagination/issues/355#issuecomment-611546207, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZFJO2VFQ2WDXZRY6HJYDTRLXI2PANCNFSM4MES3OXQ .

michaelbromley commented 4 years ago

I don't mean you need to reveal proprietary code, just a minimal reproduction that demonstrates the issue. Otherwise I would have to create the reproduction myself in order to ascertain what the problem is. This may take some time as it is not a high priority for me right now.

ajinkyabapat1 commented 4 years ago

Ok..I will try to setup a project ,but this is major bug o think , after getting page load ,pagination indicator next is visible without having data.

On Fri, Apr 10, 2020, 12:16 PM Michael Bromley notifications@github.com wrote:

I don't mean you need to reveal proprietary code, just a minimal reproduction that demonstrates the issue. Otherwise I would have to create the reproduction myself in order to ascertain what the problem is. This may take some time as it is not a high priority for me right now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/michaelbromley/ngx-pagination/issues/355#issuecomment-611904016, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZFJOYW4LFEFETR6KIJC6TRL26CRANCNFSM4MES3OXQ .

shubh48 commented 4 years ago

Yes it is showing Next button visible but no data in table

patidarpavan007 commented 3 years ago

same issue i am pursuing

patidarpavan007 commented 3 years ago

Hello,

I have added a condition to handle that problem. <pagination-controls *ngIf="myList?.length>0" (pageChange)="recordingHandlePageChange($event)">