Browse Source

Fix #117: Update docs and examples.

zhixin 11 years ago
parent
commit
ad7531586a
2 changed files with 15 additions and 2 deletions
  1. 3 2
      docs/docs.js
  2. 12 0
      docs/examples.html

+ 3 - 2
docs/docs.js

@@ -666,6 +666,7 @@ $(function () {
             ]).bootstrapTable('append', [
             ]).bootstrapTable('append', [
                 {name: 'append', parameter: 'data', description: 'Append the data to table.'},
                 {name: 'append', parameter: 'data', description: 'Append the data to table.'},
                 {name: 'remove', parameter: 'params', description: 'Remove data from table, the params contains two properties: <br>field: the field name of remove rows. <br>values: the values of remove rows.'},
                 {name: 'remove', parameter: 'params', description: 'Remove data from table, the params contains two properties: <br>field: the field name of remove rows. <br>values: the values of remove rows.'},
+                {name: 'updateRow', parameter: 'params', description: 'Update the specified row, the param contains following properties: <br>index: the row index to be updated. <br>row: the new row data.'},
                 {name: 'mergeCells', parameter: 'options', description: 'Merge some cells to one cell, the options contains following properties:'},
                 {name: 'mergeCells', parameter: 'options', description: 'Merge some cells to one cell, the options contains following properties:'},
                 {name: 'mergeCells', parameter: 'options', description: 'index: the row index.'},
                 {name: 'mergeCells', parameter: 'options', description: 'index: the row index.'},
                 {name: 'mergeCells', parameter: 'options', description: 'field: the field name.'},
                 {name: 'mergeCells', parameter: 'options', description: 'field: the field name.'},
@@ -681,11 +682,11 @@ $(function () {
                 {name: 'showColumn', parameter: 'field', description: 'Show the specified column.'},
                 {name: 'showColumn', parameter: 'field', description: 'Show the specified column.'},
                 {name: 'hideColumn', parameter: 'field', description: 'Hide the specified column.'}
                 {name: 'hideColumn', parameter: 'field', description: 'Hide the specified column.'}
             ]).bootstrapTable('mergeCells', {
             ]).bootstrapTable('mergeCells', {
-                index: 5,
+                index: 6,
                 field: 'name',
                 field: 'name',
                 rowspan: 5
                 rowspan: 5
             }).bootstrapTable('mergeCells', {
             }).bootstrapTable('mergeCells', {
-                index: 5,
+                index: 6,
                 field: 'parameter',
                 field: 'parameter',
                 rowspan: 5
                 rowspan: 5
             });
             });

+ 12 - 0
docs/examples.html

@@ -885,6 +885,9 @@
                         <button class="btn btn-default" id="remove-data" data-method="remove">
                         <button class="btn btn-default" id="remove-data" data-method="remove">
                             Remove Data
                             Remove Data
                         </button>
                         </button>
+                        <button class="btn btn-default" id="update-row" data-method="updateRow">
+                            Update Row
+                        </button>
                         <button class="btn btn-default" id="merge-cells">
                         <button class="btn btn-default" id="merge-cells">
                             Merge Cells
                             Merge Cells
                         </button>
                         </button>
@@ -965,6 +968,15 @@
                                         values: ids
                                         values: ids
                                     });
                                     });
                                 });
                                 });
+                                $('#update-row').click(function () {
+                                    $table.bootstrapTable('updateRow', {
+                                        index: 1,
+                                        row: {
+                                            name: 'test111111',
+                                            price: '$111111'
+                                        }
+                                    });
+                                });
                                 $('#merge-cells').click(function () {
                                 $('#merge-cells').click(function () {
                                     $table.bootstrapTable('mergeCells', {
                                     $table.bootstrapTable('mergeCells', {
                                         index: 1,
                                         index: 1,