浏览代码

Merge pull request #7537 from xanish/feature/get-footer-data

Added feature getFooterData
文翼 1 年之前
父节点
当前提交
7c466b48ed
共有 3 个文件被更改,包括 15 次插入0 次删除
  1. 10 0
      site/docs/api/methods.md
  2. 4 0
      src/bootstrap-table.js
  3. 1 0
      src/constants/index.js

+ 10 - 0
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`

+ 4 - 0
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)

+ 1 - 0
src/constants/index.js

@@ -377,6 +377,7 @@ const METHODS = [
   'getOptions',
   'refreshOptions',
   'getData',
+  'getFooterData',
   'getSelections',
   'load', 'append', 'prepend',
   'remove', 'removeAll',