Browse Source

Add hideHeader option.

zhixin 11 years ago
parent
commit
e3949bf781
2 changed files with 13 additions and 0 deletions
  1. 6 0
      docs/docs.js
  2. 7 0
      src/bootstrap-table.js

+ 6 - 0
docs/docs.js

@@ -120,6 +120,12 @@ $(function () {
                 type: 'String',
                 description: 'The name of radio or checkbox input.',
                 'default': 'btSelectItem'
+            },
+            {
+                name: 'hideHeader',
+                type: 'Boolean',
+                description: 'True to hide the table header.',
+                'default': 'false'
             }
         ]
     });

+ 7 - 0
src/bootstrap-table.js

@@ -62,6 +62,7 @@
         pageList: [10, 25, 50, 100],
         search: false,
         selectItemName: 'btSelectItem',
+        hideHeader: false,
 
         formatRecordsPerPage: function(pageNumber) {
             return sprintf('%s records per page', pageNumber);
@@ -185,6 +186,12 @@
                 $(this).click($.proxy(that.onSort, that));
             }
         });
+
+        if (this.options.hideHeader) {
+            this.$header.hide();
+            this.$container.find('.fixed-table-container').css('padding-top', 0);
+        }
+
         this.$selectAll = this.$header.find('[name="btSelectAll"]');
         this.$selectAll.off('click').on('click', function() {
             var checked = $(this).prop('checked');