From c0c5648d67110a9b68f7e2cf928c7bfa93b31d7c Mon Sep 17 00:00:00 2001 From: Enora Germond Date: Fri, 24 Mar 2023 17:43:55 +0100 Subject: [PATCH] Fix: Go to page one of the table when 'show inactive projects' is clicked Signed-off-by: Enora Germond --- src/views/portfolio/projects/ProjectList.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/portfolio/projects/ProjectList.vue b/src/views/portfolio/projects/ProjectList.vue index b40b9fed6..a12c1eaf6 100644 --- a/src/views/portfolio/projects/ProjectList.vue +++ b/src/views/portfolio/projects/ProjectList.vue @@ -81,7 +81,8 @@ refreshTable: function () { this.$refs.table.refresh({ url: this.apiUrl(), - silent: true + silent: true, + pageNumber: this.currentPage }); }, onLoadSuccess: function () { @@ -143,7 +144,8 @@ if (localStorage) { localStorage.setItem("ProjectListShowInactiveProjects", this.showInactiveProjects.toString()); } - this.$refs.table.showLoading() + this.$refs.table.showLoading(); + this.currentPage = 1; this.refreshTable(); }, showFlatView() { @@ -277,6 +279,7 @@ sidePagination: 'server', queryParamsType: 'pageSize', pageList: '[10, 25, 50, 100]', + currentPage: 1, pageSize: (localStorage && localStorage.getItem("ProjectListPageSize") !== null) ? Number(localStorage.getItem("ProjectListPageSize")) : 10, sortName: (localStorage && localStorage.getItem("ProjectListSortName") !== null) ? localStorage.getItem("ProjectListSortName") : undefined, sortOrder: (localStorage && localStorage.getItem("ProjectListSortOrder") !== null) ? localStorage.getItem("ProjectListSortOrder") : undefined, @@ -323,6 +326,7 @@ if (localStorage) { localStorage.setItem("ProjectListPageSize", size.toString()); } + this.currentPage = number; }), onColumnSwitch: ((field, checked) => { if (localStorage) {