Skip to content
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

ngx-bootstrap 11.0.2 issue in pagination using Angular 16 #6623

Closed
1 task
AnwarAlhamzah opened this issue Dec 6, 2023 · 3 comments
Closed
1 task

ngx-bootstrap 11.0.2 issue in pagination using Angular 16 #6623

AnwarAlhamzah opened this issue Dec 6, 2023 · 3 comments

Comments

@AnwarAlhamzah
Copy link

AnwarAlhamzah commented Dec 6, 2023

ngx-bootstrap pagination bug when navigate to next page angular for e.g.:
pageSize= 5
totalCount = 6
first page it contain 5 of 6 and create 2 navigation pages each page only and it correct
but when I navigate to next page I create 6 navigation pages each page with pageSize =1
kindly find the attache print screen for page=1 and page = 2

export class PagingNavComponent {

@input() pageIndex: number;
@input() pageSize: number;
@input() totalCount: number;

@output() pageSizeCahnge = new EventEmitter();
@output() pageNavigateChange = new EventEmitter();

ngAfterViewInit() {
console.log('after', this.pageIndex, this.pageSize, this.totalCount)
}

onPageSizeChange(event: any) {
this.pageSizeCahnge.emit(event);
}

onPageNavChange(event: any) {
console.log('nav', this.pageIndex, this.pageSize, this.totalCount)
this.pageNavigateChange.emit(event.page);
}
}

5 10 25 50
<div class="hint-text">
  Page
  <b>
    {{ (this.pageIndex - 1) * this.pageSize + 1 }}
    -
    {{
      this.pageIndex * this.pageSize > this.totalCount
        ? this.totalCount
        : this.pageIndex * this.pageSize
    }}
  </b>
  out of
  <b>
    {{ this.totalCount }}
  </b>
  Pages
</div>

<div *ngIf="this.totalCount === 0">
  There are
  <b> 0 </b>
  <b>result of</b> Pages
</div>

<pagination
[boundaryLinks]="true"
[itemsPerPage]="this.pageSize"
[totalItems]="this.totalCount"
(pageChanged)="onPageNavChange($event)"
previousText="‹"
nextText="›"
firstText="«"
lastText="»"
*ngIf="this.totalCount > 0"

![Uploading page1.PNG…]()

Tasks

@AnwarAlhamzah
Copy link
Author

#Angular16
#Ngx_Bootstrap11
#Pagination

@wangxun881217
Copy link

have any solution?

@AnwarAlhamzah
Copy link
Author

Thank you so much the problem was from back-end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants