浏览代码

Merge pull request #2027 from djhvscf/develop

feat(js): add resize event to fit the header
fix(js): the footer is hidden in card view
fix(filter-control exteinsion): add check for null values on existsOptionInSelectControl
wenzhixin 9 年之前
父节点
当前提交
4996a359c8

+ 2 - 1
.gitignore

@@ -22,4 +22,5 @@ nbproject
 .buildpath
 .idea
 .project
-.settings
+.settings
+*.iml

+ 7 - 0
CONTRIBUTING.md

@@ -43,12 +43,19 @@ Our bug tracker utilizes several labels to help organize and identify issues. He
 - `confirmed` - Issues that have been confirmed with a reduced test case and identify a bug in Bootstrap Table.
 - `css` - Issues stemming from our compiled CSS or source CSS files.
 - `docs` - Issues for improving or updating our documentation.
+- `example` - Issues that contains an important example.
 - `extension` - Issues for adding or updating our extension.
 - `feature` - Issues asking for a new feature to be added, or an existing one to be extended or modified.
+- `fixed` - Issues already fixed in a pull request.
 - `grunt` - Issues with our included JavaScript-based Gruntfile, which is used to run all our tests, concatenate and compile source files, and more.
 - `help wanted` - Issues we need or would love help from the community to resolve.
+- `invalid` - Issues we can't resolve because it is not related to Bootstrap Table or the information provided is not completed.
 - `js` - Issues stemming from our compiled or source JavaScript files.
+- `locale` - Issues regarding errors in locale extensions.
+- `needs example` - Issues don't have an example but we need an example in order to confirm the issue or test the pull request.
+- `needs review` - Issues missing some important information about errors in the code, steps to reproduce the issue, etc.
 - `resource` - Issues with helpful resources to improve Bootstrap Table.
+- `update to latest version` - Issues need to update to latest version in order to be fixed.
 
 For a complete look at our labels, see the [project labels page](https://github.com/wenzhixin/bootstrap-table/labels).
 

+ 12 - 0
docs/_i18n/en/documentation/methods.md

@@ -40,6 +40,18 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <td>getAllSelections</td>
     </tr>
     <tr>
+        <td>showAllColumns</td>
+        <td>none</td>
+        <td>Show All the columns.</td>
+        <td>showAllColumns</td>
+    </tr>
+    <tr>
+        <td>hideAllColumns</td>
+        <td>none</td>
+        <td>Hide All the columns.</td>
+        <td>hidAllColumns</td>
+    </tr>
+    <tr>
         <td>getData</td>
         <td>useCurrentPage</td>
         <td>Get the loaded data of table at the moment that this method is called. If you set the useCurrentPage to true the method will return the data in the current page.</td>

+ 12 - 0
docs/_i18n/es/documentation/methods.md

@@ -42,6 +42,18 @@ Sintaxis para llamar a un método: `$('#table').bootstrapTable('method', paramet
         </td>
     </tr>
     <tr>
+        <td>showAllColumns</td>
+        <td>none</td>
+        <td>Muestra todas las columnas.</td>
+        <td>showAllColumns</td>
+    </tr>
+    <tr>
+        <td>hideAllColumns</td>
+        <td>none</td>
+        <td>Oculta todas las columnas.</td>
+        <td>hideAllColumns</td>
+    </tr>
+    <tr>
         <td>load</td>
         <td>data</td>
         <td>Se cargan los datos en la tabla, las filas antiguas se removeran.</td>

+ 12 - 0
docs/_i18n/zh-cn/documentation/methods.md

@@ -58,6 +58,18 @@
         <td>load</td>
     </tr>
     <tr>
+        <td>showAllColumns</td>
+        <td>none</td>
+        <td>Show All the columns.</td>
+        <td>showAllColumns</td>
+    </tr>
+    <tr>
+        <td>hideAllColumns</td>
+        <td>none</td>
+        <td>Hide All the columns.</td>
+        <td>hidAllColumns</td>
+    </tr>
+    <tr>
         <td>append</td>
         <td>data</td>
         <td>添加数据到表格在现有数据之后。</td>

+ 4 - 0
src/bootstrap-table.js

@@ -826,6 +826,7 @@
             }
         });
 
+        $(window).off('resize.bootstrap-table');
         if (!this.options.showHeader || this.options.cardView) {
             this.$header.hide();
             this.$tableHeader.hide();
@@ -836,6 +837,7 @@
             this.$tableLoading.css('top', this.$header.outerHeight() + 1);
             // Assign the correct sortable arrow
             this.getCaret();
+            $(window).on('resize.bootstrap-table', $.proxy(this.resetWidth, this));
         }
 
         this.$selectAll = this.$header.find('[name="btSelectAll"]');
@@ -2107,6 +2109,7 @@
         });
 
         this.$tableFooter.find('tr').html(html.join(''));
+        this.$tableFooter.show();
         clearTimeout(this.timeoutFooter_);
         this.timeoutFooter_ = setTimeout($.proxy(this.fitFooter, this),
             this.$el.is(':hidden') ? 100 : 0);
@@ -2215,6 +2218,7 @@
             // remove the element css
             this.$el.css('margin-top', '0');
             this.$tableContainer.css('padding-bottom', '0');
+            this.$tableFooter.hide();
             return;
         }
 

+ 1 - 1
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -39,7 +39,7 @@
     var existOptionInSelectControl = function (selectControl, value) {
         var options = selectControl.get(selectControl.length - 1).options;
         for (var i = 0; i < options.length; i++) {
-            if (options[i].value === value.toString()) {
+            if (!value || options[i].value === value.toString()) {
                 //The value is not valid to add
                 return false;
             }