Browse Source

Update resetView method.

zhixin 11 years ago
parent
commit
b5eb535e2e
2 changed files with 6 additions and 2 deletions
  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: 'hideLoading', parameter: 'none', description: 'Hide loading status.'},
                 {name: 'checkAll', parameter: 'none', description: 'Check all current page rows.'},
                 {name: 'checkAll', parameter: 'none', description: 'Check all current page rows.'},
                 {name: 'uncheckAll', parameter: 'none', description: 'Uncheck 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.'}
                 {name: 'destroy', parameter: 'none', description: 'Destroy the bootstrap table.'}
             ]).bootstrapTable('mergeCells', {
             ]).bootstrapTable('mergeCells', {
                 index: 3,
                 index: 3,

+ 5 - 1
src/bootstrap-table.js

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