浏览代码

When data is empty, hide the pagination.

zhixin 11 年之前
父节点
当前提交
ae8e51dc44
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/bootstrap-table.js

+ 3 - 0
src/bootstrap-table.js

@@ -803,6 +803,9 @@
             if (this.options.pageList.length < 2 || this.options.totalRows <= this.options.pageList[1]) {
             if (this.options.pageList.length < 2 || this.options.totalRows <= this.options.pageList[1]) {
                 this.$pagination.find('span.page-list').hide();
                 this.$pagination.find('span.page-list').hide();
             }
             }
+            
+            // when data is empty, hide the pagination
+            this.$pagination[this.getData().length ? 'show' : 'hide']();
         }
         }
         $pageList.off('click').on('click', $.proxy(this.onPageListChange, this));
         $pageList.off('click').on('click', $.proxy(this.onPageListChange, this));
         $first.off('click').on('click', $.proxy(this.onPageFirst, this));
         $first.off('click').on('click', $.proxy(this.onPageFirst, this));