From 6772f4fc224314e6dd4510f5d2f562a5a3688db9 Mon Sep 17 00:00:00 2001 From: Robert Baillie Date: Wed, 12 Jan 2022 16:42:57 +0000 Subject: [PATCH] Removed accidental call to apex Added labels for the pagination controls Added ability to show / disable the pagination controls on the filterAndResults screen Default the pagination controls to the first page Disable all buttons when the controls are not properly initialised --- .../ortoo-core-CustomLabels.labels-meta.xml | 49 +++++++++++++++++++ .../filterAndResults/filterAndResults.html | 2 + .../lwc/filterAndResults/filterAndResults.js | 1 + .../paginationControls/paginationControls.js | 41 +++++++++------- 4 files changed, 76 insertions(+), 17 deletions(-) diff --git a/framework/default/ortoo-core/default/labels/ortoo-core-CustomLabels.labels-meta.xml b/framework/default/ortoo-core/default/labels/ortoo-core-CustomLabels.labels-meta.xml index ad4330c28cd..3db34357c4a 100644 --- a/framework/default/ortoo-core/default/labels/ortoo-core-CustomLabels.labels-meta.xml +++ b/framework/default/ortoo-core/default/labels/ortoo-core-CustomLabels.labels-meta.xml @@ -140,4 +140,53 @@ The title that is used on search buttons. Apply Filters + + ortoo_core_first_page + en_US + false + The label to use on the 'First Page' button of the pagination controls. + First Page + + + ortoo_core_previous_page + en_US + false + The label to use on the 'Previous Page' button of the pagination controls. + Previous + + + ortoo_core_next_page + en_US + false + The label to use on the 'Next Page' button of the pagination controls. + Next + + + ortoo_core_last_page + en_US + false + The label to use on the 'Last Page' button of the pagination controls. + Last Page + + + ortoo_core_total_records + en_US + false + The label that is used with a 'Total Records' count. + Total Records + + + ortoo_core_page_size + en_US + false + The label that is used with a 'Page Size' count. + Page Size + + + ortoo_core_page_number_description + en_US + false + Describes the page no. of a total. {0} - Current Page, {1} - Total Pages. + Page {0} of {1} + \ No newline at end of file diff --git a/framework/default/ortoo-core/default/lwc/filterAndResults/filterAndResults.html b/framework/default/ortoo-core/default/lwc/filterAndResults/filterAndResults.html index 81b95125227..723763c9a4d 100644 --- a/framework/default/ortoo-core/default/lwc/filterAndResults/filterAndResults.html +++ b/framework/default/ortoo-core/default/lwc/filterAndResults/filterAndResults.html @@ -47,6 +47,7 @@ = this.numberOfPages; } + get initialised() { + return this.numberOfRecords && this.recordsPerPage && this.currentPage; + } + get disableFirstButton() { - return this.onFirstPage; + return this.initialised && this.onFirstPage; } get disablePreviousButton() { - return this.onFirstPage; + return this.initialised && this.onFirstPage; } get disableNextButton() { - return this.onLastPage; + return this.initialised && this.onLastPage; } get disableLastButton() { - return this.onLastPage; + return this.initialised && this.onLastPage; } handleFirstClick( event ) {