From add3f979b2a4aab6e2c152befa0e7af9744f7ce5 Mon Sep 17 00:00:00 2001 From: gkolokythas Date: Fri, 17 May 2019 10:17:23 +0300 Subject: [PATCH] Fixes the pagination on explore DMP and explore Datasets. --- .../explore-dataset/explore-dataset-listing.component.html | 3 +-- .../ui/explore-dataset/explore-dataset-listing.component.ts | 5 +++++ .../app/ui/explore-dmp/explore-dmp-listing.component.html | 2 +- .../src/app/ui/explore-dmp/explore-dmp-listing.component.ts | 5 +++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html index fed53183f..ef51e583f 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html +++ b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html @@ -22,8 +22,7 @@
- - + diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts index c72559b88..ed24ef189 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.ts @@ -43,6 +43,7 @@ export class ExploreDatasetListingComponent extends BaseComponent implements OnI } refresh() { + if (this._paginator.pageSize === undefined) this._paginator.pageSize = 10; const startIndex = this._paginator.pageIndex * this._paginator.pageSize; let fields: Array = new Array(); if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; } @@ -72,4 +73,8 @@ export class ExploreDatasetListingComponent extends BaseComponent implements OnI // } return defaultCriteria; } + + pageThisEvent(event) { + this.refresh(); + } } diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html index 4bbb57e4c..4df53de2b 100644 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html +++ b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.html @@ -23,7 +23,7 @@
- + diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts index 6459a5a87..f6801edc3 100644 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts @@ -43,6 +43,7 @@ export class ExploreDmpListingComponent extends BaseComponent implements OnInit, } refresh() { + if (this._paginator.pageSize === undefined) this._paginator.pageSize = 10; const startIndex = this._paginator.pageIndex * this._paginator.pageSize; let fields: Array = new Array(); if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; } @@ -70,6 +71,10 @@ export class ExploreDmpListingComponent extends BaseComponent implements OnInit, this.refresh(); } + pageThisEvent(event) { + this.refresh(); + } + // @ViewChild(MatPaginator) _paginator: MatPaginator; // @ViewChild(MatSort) sort: MatSort; // criteria: ExploreDmpCriteriaModel = new ExploreDmpCriteriaModel();