Browse Source

Merge pull request #4762 from wenzhixin/fix/remove-all-last-page

Fixed removeAll bug in the last page when sidePagination is server
Dustin Utecht 6 years ago
parent
commit
c701130083
2 changed files with 9 additions and 1 deletions
  1. 1 1
      package.json
  2. 8 0
      src/bootstrap-table.js

+ 1 - 1
package.json

@@ -46,7 +46,7 @@
     "js:build": "run-s js:build:*",
     "js:build": "run-s js:build:*",
     "css:build:scss": "find src -name 'bootstrap-table*.scss' | sed -e 'p;s/scss/css/' | xargs -n2 sass",
     "css:build:scss": "find src -name 'bootstrap-table*.scss' | sed -e 'p;s/scss/css/' | xargs -n2 sass",
     "css:build:base": "find src -name '*.css' | sed -e 'p;s/src/dist/' | xargs -n2 cp",
     "css:build:base": "find src -name '*.css' | sed -e 'p;s/src/dist/' | xargs -n2 cp",
-    "css:build:min": "find dist -name '*.css' | sed -e 'p;s/.css/.min.css/' | xargs -n2 cssmin",
+    "css:build:min": "find dist -name '*.css' -not -name '*.min.css' | sed -e 'p;s/.css/.min.css/' | xargs -n2 cssmin",
     "css:build:banner": "find dist -name '*.min.css' -exec headr {} -o {} --version --homepage --author --license \\;",
     "css:build:banner": "find dist -name '*.min.css' -exec headr {} -o {} --version --homepage --author --license \\;",
     "css:build": "run-s css:build:*",
     "css:build": "run-s css:build:*",
     "clean": "rm -rf dist",
     "clean": "rm -rf dist",

+ 8 - 0
src/bootstrap-table.js

@@ -1654,6 +1654,14 @@ class BootstrapTable {
         if (!silent) {
         if (!silent) {
           this.hideLoading()
           this.hideLoading()
         }
         }
+
+        if (
+          this.options.sidePagination === 'server' &&
+          res[this.options.totalField] > 0 &&
+          !res[this.options.dataField].length
+        ) {
+          this.updatePagination()
+        }
       },
       },
       error: jqXHR => {
       error: jqXHR => {
         let data = []
         let data = []