浏览代码

Update resetView method.

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

+ 1 - 1
docs/docs.js

@@ -393,7 +393,7 @@ $(function () {
                 {name: 'hideLoading', parameter: 'none', description: 'Hide loading status.'},
                 {name: 'checkAll', parameter: 'none', description: 'Check all current page rows.'},
                 {name: 'uncheckAll', parameter: 'none', description: 'Uncheck all current page rows.'},
-                {name: 'resetView', parameter: 'none', description: 'Reset the bootstrap table view, like display error when init the table with display: none.'},
+                {name: 'resetView', parameter: 'params', description: 'Reset the bootstrap table view, for example reset the table height.'},
                 {name: 'destroy', parameter: 'none', description: 'Destroy the bootstrap table.'}
             ]).bootstrapTable('mergeCells', {
                 index: 3,

+ 5 - 1
src/bootstrap-table.js

@@ -831,10 +831,14 @@
     // PUBLIC FUNCTION DEFINITION
     // =======================
 
-    BootstrapTable.prototype.resetView = function () {
+    BootstrapTable.prototype.resetView = function (params) {
         var that = this,
             header = this.header;
 
+        if (params && params.height) {
+            this.options.height = params.height;
+        }
+
         this.$selectAll.prop('checked', this.$selectItem.length > 0 &&
             this.$selectItem.length === this.$selectItem.filter(':checked').length);