ソースを参照

Added gtHiddenColumns method

Dennis Hernández 10 年 前
コミット
8cd6e6be88

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

@@ -226,6 +226,11 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <td>Hide the specified column.</td>
         <td>Hide the specified column.</td>
     </tr>
     </tr>
     <tr>
     <tr>
+        <td>getHiddenColumns</td>
+        <td>-</td>
+        <td>Get hidden columns.</td>
+    </tr>
+    <tr>
         <td>scrollTo</td>
         <td>scrollTo</td>
         <td>value</td>
         <td>value</td>
         <td>Scroll to the number value position, set 'bottom' means scroll to the bottom.</td>
         <td>Scroll to the number value position, set 'bottom' means scroll to the bottom.</td>

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

@@ -217,6 +217,11 @@ Sintaxis para llamar a un método: `$('#table').bootstrapTable('method', paramet
         <td>Oculta la columna especificada.</td>
         <td>Oculta la columna especificada.</td>
     </tr>
     </tr>
     <tr>
     <tr>
+        <td>getHiddenColumns</td>
+        <td>-</td>
+        <td>Obtiene las columnas ocultas.</td>
+    </tr>
+    <tr>
         <td>scrollTo</td>
         <td>scrollTo</td>
         <td>value</td>
         <td>value</td>
         <td>Setea la posición del scroll, setear 'bottom' significa setear la posición del scroll al final de la tabla.</td>
         <td>Setea la posición del scroll, setear 'bottom' significa setear la posición del scroll al final de la tabla.</td>

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

@@ -205,6 +205,11 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <td>Hide the specified column.</td>
         <td>Hide the specified column.</td>
     </tr>
     </tr>
     <tr>
     <tr>
+        <td>getHiddenColumns</td>
+        <td>-</td>
+        <td>Get hidden columns.</td>
+    </tr>
+    <tr>
         <td>scrollTo</td>
         <td>scrollTo</td>
         <td>value</td>
         <td>value</td>
         <td>Scroll to the number value position, set 'bottom' means scroll to the bottom.</td>
         <td>Scroll to the number value position, set 'bottom' means scroll to the bottom.</td>

+ 7 - 1
src/bootstrap-table.js

@@ -2191,6 +2191,12 @@
         this.toggleColumn(getFieldIndex(this.options.columns, field), false, true);
         this.toggleColumn(getFieldIndex(this.options.columns, field), false, true);
     };
     };
 
 
+    BootstrapTable.prototype.getHiddenColumns = function () {
+        return $.grep(this.options.columns, function( column ) {
+            return !column.visible;
+        });
+    };
+
     BootstrapTable.prototype.filterBy = function (columns) {
     BootstrapTable.prototype.filterBy = function (columns) {
         this.filterColumns = $.isEmptyObject(columns) ? {} : columns;
         this.filterColumns = $.isEmptyObject(columns) ? {} : columns;
         this.options.pageNumber = 1;
         this.options.pageNumber = 1;
@@ -2273,7 +2279,7 @@
         'resetWidth',
         'resetWidth',
         'destroy',
         'destroy',
         'showLoading', 'hideLoading',
         'showLoading', 'hideLoading',
-        'showColumn', 'hideColumn',
+        'showColumn', 'hideColumn', 'getHiddenColumns',
         'filterBy',
         'filterBy',
         'scrollTo',
         'scrollTo',
         'getScrollPosition',
         'getScrollPosition',