configurable 'supportedPageSizes' for document list (#2395)

This commit is contained in:
Denys Vuika 2017-09-29 06:58:12 -04:00 committed by Eugenio Romano
parent f224c594c6
commit d789f84ed5
5 changed files with 9 additions and 2 deletions

View File

@ -27,6 +27,7 @@
}
},
"document-list": {
"supportedPageSizes": [5, 10, 15, 20],
"presets": {
"-trashcan-": [
{

View File

@ -27,6 +27,7 @@
}
},
"document-list": {
"supportedPageSizes": [5, 10, 15, 20],
"presets": {
"-trashcan-": [
{

View File

@ -111,6 +111,7 @@ The properties currentFolderId, folderNode and node are the entry initialization
| allowDropFiles | boolean | false | Toggle file drop support for rows (see **ng2-alfresco-core/UploadDirective** for more details) |
| sorting | string[] | | Defines default sorting. The format is an array of 2 strings `[key, direction]` i.e. `['name', 'desc']` or `['name', 'asc']`. Set this value only if you want to override default sorting detected by the component based on columns. |
| locationFormat | string | '/' | The default route for all the location-based columns (if declared). |
| supportedPageSizes | number[] | [5, 10, 15, 20] | Supported page sizes for the pagination component. You can also use application configuration file to set it as a global setting using `document-list.supportedPageSizes` key. |
#### Events

View File

@ -58,7 +58,7 @@
(nextPage)="onNextPage($event)"
(prevPage)="onPrevPage($event)"
[pagination]="pagination"
[supportedPageSizes]="[5, 10, 15, 20]">
[supportedPageSizes]="supportedPageSizes">
</adf-pagination>
<adf-infinite-pagination
@ -69,4 +69,4 @@
(loadMore)="loadNextBatch($event)">
{{ 'ADF-DOCUMENT-LIST.LAYOUT.LOAD_MORE' | translate }}
</adf-infinite-pagination>
</ng-container>
</ng-container>

View File

@ -107,6 +107,9 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
@Input()
paginationStrategy: PaginationStrategy = PaginationStrategy.Finite;
@Input()
supportedPageSizes: number[];
infiniteLoading: boolean = false;
selection = new Array<MinimalNodeEntity>();
@ -165,6 +168,7 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
private elementRef: ElementRef,
private apiService: AlfrescoApiService,
private appConfig: AppConfigService) {
this.supportedPageSizes = appConfig.get('document-list.supportedPageSizes', [5, 10, 15, 20]);
}
private get nodesApi() {