Browse Source

remove unnecessary method

Dustin Utecht 5 years ago
parent
commit
2fa0df6330
3 changed files with 2 additions and 16 deletions
  1. 1 10
      site/docs/api/methods.md
  2. 0 5
      src/bootstrap-table.js
  3. 1 1
      src/constants/index.js

+ 1 - 10
site/docs/api/methods.md

@@ -167,16 +167,6 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 - **Example:** [Filter By](https://examples.bootstrap-table.com/#methods/filter-by.html)
 
-## getAllSelections
-
-- **Parameter:** `undefined`
-
-- **Detail:**
-
-  Return all selected rows contain search or filter, when no record selected, an empty array will return.
-
-- **Example:** [Get All Selections](https://examples.bootstrap-table.com/#methods/get-all-selections.html)
-
 ## getData
 
 - **Parameter:** `params`
@@ -249,6 +239,7 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 - **Detail:**
 
   Return selected rows, when no record selected, an empty array will return.
+  The selected rows will be unselected while some actions happens e.g. searching or page change, if you want to maintain the selections please use [maintainMetaData](https://bootstrap-table.com/docs/api/table-options/#maintainmetadata). 
 
 - **Example:** [Get Selections](https://examples.bootstrap-table.com/#methods/get-selections.html)
 

+ 0 - 5
src/bootstrap-table.js

@@ -2227,11 +2227,6 @@ class BootstrapTable {
   }
 
   getSelections () {
-    // fix #2424: from html with checkbox
-    return this.data.filter(row => row[this.header.stateField] === true)
-  }
-
-  getAllSelections () {
     return this.options.data.filter(row => row[this.header.stateField] === true)
   }
 

+ 1 - 1
src/constants/index.js

@@ -501,7 +501,7 @@ const METHODS = [
   'getOptions',
   'refreshOptions',
   'getData',
-  'getSelections', 'getAllSelections',
+  'getSelections',
   'load', 'append', 'prepend',
   'remove', 'removeAll',
   'insertRow', 'updateRow',