mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
add reset pagination (#3239)
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
AuthenticationService, AppConfigService, ContentService, TranslationService,
|
||||
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
|
||||
UploadService, DataColumn, DataRow, UserPreferencesService,
|
||||
PaginationComponent, FormValues, DisplayMode, UserPreferenceValues
|
||||
PaginationComponent, FormValues, DisplayMode, UserPreferenceValues, InfinitePaginationComponent
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import { DocumentListComponent, PermissionStyleModel } from '@alfresco/adf-content-services';
|
||||
@@ -149,6 +149,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@ViewChild('standardPagination')
|
||||
standardPagination: PaginationComponent;
|
||||
|
||||
@ViewChild(InfinitePaginationComponent)
|
||||
infinitePaginationComponent: InfinitePaginationComponent;
|
||||
|
||||
|
||||
permissionsStyle: PermissionStyleModel[] = [];
|
||||
infiniteScrolling: boolean;
|
||||
supportedPages: number[];
|
||||
@@ -349,9 +353,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
private reloadForInfiniteScrolling() {
|
||||
if (this.infiniteScrolling) {
|
||||
this.documentList.skipCount = 0;
|
||||
}
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
@@ -462,7 +463,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.turnedNextPage.emit(event);
|
||||
}
|
||||
|
||||
loadNextBatch(event: Pagination) {
|
||||
loadNextBatch(event: Pagination): void {
|
||||
this.loadNext.emit(event);
|
||||
}
|
||||
|
||||
@@ -484,4 +485,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.location.go(url);
|
||||
}
|
||||
}
|
||||
|
||||
onInfiniteScrolling(): void {
|
||||
this.infiniteScrolling = !this.infiniteScrolling;
|
||||
this.infinitePaginationComponent.reset();
|
||||
this.reloadForInfiniteScrolling();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user