Browse Source

Add options method.

zhixin 11 years ago
parent
commit
34564c6938

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

@@ -18,6 +18,11 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
     </thead>
     <tbody>
     <tr>
+        <td>options</td>
+        <td>none</td>
+        <td>Return the options object.</td>
+    </tr>
+    <tr>
         <td>getSelections</td>
         <td>none</td>
         <td>Return all selected rows, when no record selected, am empty array will return.</td>

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

@@ -18,6 +18,11 @@ Sintaxis para llamar a un método: `$('#table').bootstrapTable('method', paramet
     </thead>
     <tbody>
     <tr>
+        <td>options</td>
+        <td>none</td>
+        <td>Return the options object.</td>
+    </tr>
+    <tr>
         <td>getSelections</td>
         <td>none</td>
         <td>Retorna todas las filas seleccionadas, cuando no hay seleccionadas, se retorna un array vacío .</td>

+ 21 - 1
docs/_i18n/fr/documentation/methods.md

@@ -18,6 +18,11 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
     </thead>
     <tbody>
     <tr>
+        <td>options</td>
+        <td>none</td>
+        <td>Return the options object.</td>
+    </tr>
+    <tr>
         <td>getSelections</td>
         <td>none</td>
         <td>Return all selected rows, when no record selected, am empty array will return.</td>
@@ -38,12 +43,27 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <td>Append the data to table.</td>
     </tr>
     <tr>
+        <td>prepend</td>
+        <td>data</td>
+        <td>Prepend the data to table.</td>
+    </tr>
+    <tr>
         <td>remove</td>
         <td>params</td>
         <td>
         Remove data from table, the params contains two properties: <br>
         field: the field name of remove rows. <br>
-        values: the values of remove rows.
+        values: the array of values for rows which should be removed. <br>
+        Example: $('#myTable').bootstrapTable('remove', {field: 'id', values: ["73", "74"]})
+        </td>
+    </tr>
+    <tr>
+        <td>insertRow</td>
+        <td>params</td>
+        <td>
+        Insert a new row, the param contains following properties:<br>
+        index: the row index to insert into.<br>
+        row: the row data.
         </td>
     </tr>
     <tr>

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

@@ -18,6 +18,11 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
     </thead>
     <tbody>
     <tr>
+        <td>options</td>
+        <td>none</td>
+        <td>Return the options object.</td>
+    </tr>
+    <tr>
         <td>getSelections</td>
         <td>none</td>
         <td>Return all selected rows, when no record selected, am empty array will return.</td>

+ 5 - 0
src/bootstrap-table.js

@@ -1493,6 +1493,10 @@
         $td.attr('rowspan', rowspan).attr('colspan', colspan).show();
     };
 
+    BootstrapTable.prototype.options = function () {
+        return this.options;
+    };
+
     BootstrapTable.prototype.getSelections = function () {
         var that = this;
 
@@ -1605,6 +1609,7 @@
     // =======================
 
     var allowedMethods = [
+        'options',
         'getSelections', 'getData',
         'load', 'append', 'prepend', 'remove',
         'insertRow', 'updateRow',