From 02c3b66fb15a923e8020ca4c3313e3df83b05f0b Mon Sep 17 00:00:00 2001 From: xanish Date: Mon, 30 Sep 2024 23:09:04 +0530 Subject: [PATCH 1/2] Added support for getFooterData --- src/bootstrap-table.js | 4 ++++ src/constants/index.js | 1 + 2 files changed, 5 insertions(+) diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index adbe9dba0..f7e07292c 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -2483,6 +2483,10 @@ class BootstrapTable { return data } + getFooterData () { + return this.footerData ?? [] + } + getSelections () { return (this.options.maintainMetaData ? this.options.data : this.data) .filter(row => row[this.header.stateField] === true) diff --git a/src/constants/index.js b/src/constants/index.js index 1d983435e..f832ed313 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -377,6 +377,7 @@ const METHODS = [ 'getOptions', 'refreshOptions', 'getData', + 'getFooterData', 'getSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', From 2fc9f0c6f9bc7187d35b25a7877bcabb075ca529 Mon Sep 17 00:00:00 2001 From: xanish Date: Mon, 30 Sep 2024 23:42:20 +0530 Subject: [PATCH 2/2] Updated docs for getFooterData --- site/docs/api/methods.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/site/docs/api/methods.md b/site/docs/api/methods.md index 633042a03..7189b378a 100644 --- a/site/docs/api/methods.md +++ b/site/docs/api/methods.md @@ -183,6 +183,16 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`. - **Example:** [Get Data](https://examples.bootstrap-table.com/#methods/get-data.html) +## getFooterData + +- **Parameter:** `undefined` + +- **Detail:** + + Get the loaded data of the footer at the moment that this method is called + +- **Example:** [Get Footer Data](https://examples.bootstrap-table.com/#methods/get-footer-data.html) + ## getHiddenColumns - **Parameter:** `undefined`