mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
[ADF-1805] rebased documentlist pagination removal (#2668)
* [ADF-1805] rebased documentlist pagination removal * [ADF-1805] fixed some wrong changes]
This commit is contained in:
@@ -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>
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user