Browse Source

Merge pull request #13 from wenzhixin/master

Update my repo
Dennis Hernández 11 years ago
parent
commit
936e5bf587

+ 2 - 2
CHANGELOG.md

@@ -17,7 +17,7 @@
 - [enh] Add a toggle pagination toolbar button.
 - [enh] Add `iconSize` option.
 - [enh] Add `buttonsAlign` option and update `toolbarAlign` option.
-- [enh] Add prepend and insertRow methods.
+- [enh] Add `prepend`, `insertRow` and `toggleView` methods.
 
 ### 1.5.0
 
@@ -219,4 +219,4 @@
 
 ### 1.0.0
 
-* Initial release
+* Initial release

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

@@ -171,5 +171,12 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <td>none</td>
         <td>Toggle the pagination option.</td>
     </tr>
+    <tr>
+        <td>toggleView</td>
+        <td>none</td>
+        <td>Toggle the card/table view.</td>
+    </tr>
+    </tbody>
+</table>
     </tbody>
 </table>

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

@@ -171,5 +171,10 @@ Sintaxis para llamar a un método: `$('#table').bootstrapTable('method', paramet
         <td>none</td>
         <td>Habilita y deshabilita la paginación.</td>
     </tr>
+    <tr>
+        <td>toggleView</td>
+        <td>none</td>
+        <td>Toggle the card/table view.</td>
+    </tr>
     </tbody>
 </table>

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

@@ -171,5 +171,10 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <td>none</td>
         <td>Toggle the pagination option.</td>
     </tr>
+    <tr>
+        <td>toggleView</td>
+        <td>none</td>
+        <td>Toggle the card/table view.</td>
+    </tr>
     </tbody>
 </table>

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

@@ -171,5 +171,10 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <td>none</td>
         <td>Toggle the pagination option.</td>
     </tr>
+    <tr>
+        <td>toggleView</td>
+        <td>none</td>
+        <td>Toggle the card/table view.</td>
+    </tr>
     </tbody>
 </table>

+ 8 - 1
src/bootstrap-table.js

@@ -1618,6 +1618,12 @@
         }
     };
 
+    BootstrapTable.prototype.toggleView = function () {
+        this.options.cardView = !this.options.cardView;
+        this.initHeader();
+        this.initBody();
+    };
+
     // BOOTSTRAP TABLE PLUGIN DEFINITION
     // =======================
 
@@ -1637,7 +1643,8 @@
         'filterBy',
         'scrollTo',
         'selectPage', 'prevPage', 'nextPage',
-        'togglePagination'
+        'togglePagination',
+        'toggleView'
     ];
 
     $.fn.bootstrapTable = function (option, _relatedTarget) {