mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Process list implement pagination interface (#2872)
This commit is contained in:
committed by
Eugenio Romano
parent
105bc80d2c
commit
0f6ac42e4c
@@ -168,6 +168,7 @@ export class PaginationComponent implements OnInit, OnDestroy {
|
||||
if (this.hasItems) {
|
||||
const maxItems = this.pagination.maxItems;
|
||||
const skipCount = (this.next - 1) * maxItems;
|
||||
this.pagination.skipCount = skipCount;
|
||||
|
||||
this.handlePaginationEvent(PaginationComponent.ACTIONS.NEXT_PAGE, {
|
||||
skipCount,
|
||||
@@ -180,6 +181,7 @@ export class PaginationComponent implements OnInit, OnDestroy {
|
||||
if (this.hasItems) {
|
||||
const maxItems = this.pagination.maxItems;
|
||||
const skipCount = (this.previous - 1) * maxItems;
|
||||
this.pagination.skipCount = skipCount;
|
||||
|
||||
this.handlePaginationEvent(PaginationComponent.ACTIONS.PREV_PAGE, {
|
||||
skipCount,
|
||||
@@ -192,6 +194,7 @@ export class PaginationComponent implements OnInit, OnDestroy {
|
||||
if (this.hasItems) {
|
||||
const maxItems = this.pagination.maxItems;
|
||||
const skipCount = (pageNumber - 1) * maxItems;
|
||||
this.pagination.skipCount = skipCount;
|
||||
|
||||
this.handlePaginationEvent(PaginationComponent.ACTIONS.CHANGE_PAGE_NUMBER, {
|
||||
skipCount,
|
||||
@@ -201,6 +204,8 @@ export class PaginationComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
onChangePageSize(maxItems: number) {
|
||||
this.pagination.skipCount = 0;
|
||||
this.pagination.maxItems = maxItems;
|
||||
this.handlePaginationEvent(PaginationComponent.ACTIONS.CHANGE_PAGE_SIZE, {
|
||||
skipCount: 0,
|
||||
maxItems
|
||||
|
Reference in New Issue
Block a user