3
votes

Please see the below stackblitz link for reference

https://stackblitz.com/edit/angular-l4mzdb?file=src%2Fapp%2Fapp.component.ts

in the output pager component is showing but pager component is not considering the data to apply pagination.

Please let me know if any one can answer.

1

1 Answers

2
votes

The pagination should be handled by us based on the current page and page size. I have modified the sample to do so.

https://stackblitz.com/edit/angular-pager

In the sample introduced new variable view which shows the current page and view is refreshed with new values based on the arguments from the Pager component click event.

<ejs-pager  [pageSize]= '10' [pageCount]='9'  
[totalRecordsCount]='data.length' (click)="click($event)"></ejs-pager>

export class AppComponent implements OnInit {
  view;
  .....
  click(args) {
    if (args.currentPage) {
      let start = (args.currentPage - 1) * 10;
      this.view = this.data.slice(start, start + 10);
    }
  }

}

https://ej2.syncfusion.com/angular/documentation/api/pager/#click