ソースを参照

Added 'all' option in pagination

Dennis Hernández 10 年 前
コミット
cd4ef27977
1 ファイル変更4 行追加1 行削除
  1. 4 1
      src/bootstrap-table.js

+ 4 - 1
src/bootstrap-table.js

@@ -1059,13 +1059,16 @@
             if (this.totalPages <= 1) {
                 this.$pagination.find('div.pagination').hide();
             }
-            if (this.options.pageList.length < 2 || this.options.totalRows <= this.options.pageList[0]) {
+            if (pageList.length < 2 || this.options.totalRows <= pageList[0]) {
                 this.$pagination.find('span.page-list').hide();
             }
 
             // when data is empty, hide the pagination
             this.$pagination[this.getData().length ? 'show' : 'hide']();
         }
+        if ($allSelected) {
+            this.options.pageSize = this.options.formatAllRows();
+        }
         $pageList.off('click').on('click', $.proxy(this.onPageListChange, this));
         $first.off('click').on('click', $.proxy(this.onPageFirst, this));
         $pre.off('click').on('click', $.proxy(this.onPagePre, this));