diff --git a/demo-shell-ng2/app.config-dev.json b/demo-shell-ng2/app.config-dev.json index 9ae8783b2a..d8dd5d886e 100644 --- a/demo-shell-ng2/app.config-dev.json +++ b/demo-shell-ng2/app.config-dev.json @@ -27,6 +27,7 @@ } }, "document-list": { + "supportedPageSizes": [5, 10, 15, 20], "presets": { "-trashcan-": [ { diff --git a/demo-shell-ng2/app.config-prod.json b/demo-shell-ng2/app.config-prod.json index 524f6f7bd6..053fac90ef 100644 --- a/demo-shell-ng2/app.config-prod.json +++ b/demo-shell-ng2/app.config-prod.json @@ -27,6 +27,7 @@ } }, "document-list": { + "supportedPageSizes": [5, 10, 15, 20], "presets": { "-trashcan-": [ { diff --git a/ng2-components/ng2-alfresco-documentlist/README.md b/ng2-components/ng2-alfresco-documentlist/README.md index 1ea7378ab1..60a04e5070 100644 --- a/ng2-components/ng2-alfresco-documentlist/README.md +++ b/ng2-components/ng2-alfresco-documentlist/README.md @@ -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 diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.html b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.html index db754a46d2..9187fcee58 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.html +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.html @@ -58,7 +58,7 @@ (nextPage)="onNextPage($event)" (prevPage)="onPrevPage($event)" [pagination]="pagination" - [supportedPageSizes]="[5, 10, 15, 20]"> + [supportedPageSizes]="supportedPageSizes"> {{ 'ADF-DOCUMENT-LIST.LAYOUT.LOAD_MORE' | translate }} - \ No newline at end of file + diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts index 71f41b57ea..7283b034e8 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.component.ts @@ -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(); @@ -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() {