[ADF-1805] rebased documentlist pagination removal (#2668)

* [ADF-1805] rebased documentlist pagination removal

* [ADF-1805] fixed some wrong changes]
This commit is contained in:
Vito
2017-11-20 10:40:05 +00:00
committed by Popovics András
parent 0f0f22634a
commit 141bc0f8b4
12 changed files with 198 additions and 249 deletions

View File

@@ -1,4 +1,6 @@
<adf-search [searchTerm]="searchedWord"
[maxResults]="maxItems"
[skipResults]="skipCount"
(resultLoaded)="showSearchResult($event)"
#search>
</adf-search>
@@ -6,5 +8,10 @@
<adf-files-component
[currentFolderId]="null"
[nodeResult]="resultNodePageList"
(documentListReady)="refreshResults($event)">
(documentListReady)="refreshResults($event)"
(changedPageSize)="refreshPage($event)"
(changedPageNumber)="refreshPage($event)"
(turnedNextPage)="refreshPage($event)"
(loadNext)="refreshPage($event)"
(turnedPreviousPage)="refreshPage($event)">
</adf-files-component>

View File

@@ -17,8 +17,9 @@
import { Component, OnInit, Optional, ViewChild } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { NodePaging } from 'alfresco-js-api';
import { NodePaging, Pagination } from 'alfresco-js-api';
import { SearchComponent } from '@alfresco/adf-content-services';
import { UserPreferencesService } from '@alfresco/adf-core';
@Component({
selector: 'adf-search-result-component',
@@ -36,9 +37,14 @@ export class SearchResultComponent implements OnInit {
fileShowed: boolean = false;
navigationMode: string = 'dblclick';
resultNodePageList: NodePaging;
maxItems: number;
skipCount: number = 0;
paging: Pagination;
constructor(public router: Router,
private preferences: UserPreferencesService,
@Optional() private route: ActivatedRoute) {
this.maxItems = this.preferences.paginationSize;
}
ngOnInit() {
@@ -51,9 +57,15 @@ export class SearchResultComponent implements OnInit {
showSearchResult(event: NodePaging) {
this.resultNodePageList = event;
this.paging = event.list.pagination;
}
refreshResults(event: any) {
this.search.reload();
}
refreshPage(event: Pagination) {
this.maxItems = event.maxItems;
this.skipCount = event.skipCount;
}
}