Browse Source

#82: Add example and docs of 'getData' method.

zhixin 11 years ago
parent
commit
e3f90fb096
2 changed files with 9 additions and 2 deletions
  1. 3 2
      docs/docs.js
  2. 6 0
      docs/examples.html

+ 3 - 2
docs/docs.js

@@ -652,6 +652,7 @@ $(function () {
             ]
         }).bootstrapTable('load', [
                 {name: 'getSelections', parameter: 'none', description: 'Return all selected rows, when no record selected, am empty array will return.'},
+                {name: 'getData', parameter: 'none', description: 'Get the data of table.'},
                 {name: 'load', parameter: 'data', description: 'Load the data to table.'}
             ]).bootstrapTable('append', [
                 {name: 'append', parameter: 'data', description: 'Append the data to table.'},
@@ -670,11 +671,11 @@ $(function () {
                 {name: 'showColumn', parameter: 'field', description: 'Show the specified column.'},
                 {name: 'hideColumn', parameter: 'field', description: 'Hide the specified column.'}
             ]).bootstrapTable('mergeCells', {
-                index: 3,
+                index: 4,
                 field: 'name',
                 rowspan: 5
             }).bootstrapTable('mergeCells', {
-                index: 3,
+                index: 4,
                 field: 'parameter',
                 rowspan: 5
             });

+ 6 - 0
docs/examples.html

@@ -869,6 +869,9 @@
                         <button class="btn btn-default" id="get-selections">
                             Get Selections
                         </button>
+                        <button class="btn btn-default" id="get-data" data-method="getData">
+                            Get Data
+                        </button>
                         <button class="btn btn-default" id="load-data" data-method="load">
                             Load Data
                         </button>
@@ -937,6 +940,9 @@
                                 $('#get-selections').click(function () {
                                     alert('Selected values: ' + JSON.stringify($table.bootstrapTable('getSelections')));
                                 });
+                                $('#get-data').click(function () {
+                                    alert('current data: ' + JSON.stringify($table.bootstrapTable('getData')));
+                                });
                                 $('#load-data, #append-data, #check-all, #uncheck-all, ' +
                                         '#show-loading, #hide-loading, #refresh').click(function () {
                                     $table.bootstrapTable($(this).data('method'), getRows());