ソースを参照

Update docs and examples.

zhixin 11 年 前
コミット
bc786376fc
3 ファイル変更15 行追加9 行削除
  1. 6 3
      docs/docs.js
  2. 7 6
      docs/examples.html
  3. 2 0
      docs/examples.js

+ 6 - 3
docs/docs.js

@@ -1,4 +1,6 @@
 $(function () {
+    'use strict';
+
     $('#table').bootstrapTable({
         columns: [
             {field: 'name', title: 'Name', align: 'center', width: 60, sortable: true},
@@ -278,7 +280,7 @@ $(function () {
                 name: 'onLoadError',
                 parameter: 'status',
                 description: 'Fires when some errors occur to load remote data.'
-            },
+            }
         ],
         onClickRow: function (row) {
             console.log('onClickRow', row);
@@ -310,13 +312,14 @@ $(function () {
             {name: 'load', parameter: 'data', description: 'Load the data to table.'}
         ]).bootstrapTable('append', [
             {name: 'append', parameter: 'data', description: 'Append the data to table.'},
-            {name: 'showLoading', parameter: 'none', description: 'Show loading status.'},
-            {name: 'hideLoading', parameter: 'none', description: 'Hide loading status.'},
             {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: 'field: the field name.'},
             {name: 'mergeCells', parameter: 'options', description: 'rowspan: the rowspan count to be merged.'},
             {name: 'mergeCells', parameter: 'options', description: 'colspan: the colspan count to be merged.'},
+            {name: 'refresh', parameter: 'none', description: 'Refresh the remote server data.'},
+            {name: 'showLoading', parameter: 'none', description: 'Show loading status.'},
+            {name: 'hideLoading', parameter: 'none', description: 'Hide loading status.'},
             {name: 'checkAll', parameter: 'none', description: 'Check all current page rows.'},
             {name: 'uncheckAll', parameter: 'none', description: 'Uncheck all current page rows.'},
             {name: 'resetView', parameter: 'none', description: 'Reset the bootstrap table view, like display error when init the table with display: none.'},

+ 7 - 6
docs/examples.html

@@ -439,7 +439,7 @@
                     <h1 id="table-methods">Table methods</h1>
                 </div>
                 <div class="bs-example">
-                    <div class="btn-group btn-default">
+                    <div class="btn-group">
                         <button class="btn btn-default" id="get-selections">
                             Get Selections
                         </button>
@@ -464,8 +464,11 @@
                         <button class="btn btn-default" id="hide-loading" data-method="hideLoading">
                             Hide Loading
                         </button>
+                        <button class="btn btn-default" id="refresh" data-method="refresh">
+                            Refresh
+                        </button>
                     </div>
-                    <table id="table-methods-table" data-height="246">
+                    <table id="table-methods-table" data-height="246" data-url="data1.json">
                         <thead>
                         <tr>
                             <th data-field="state" data-checkbox="true"></th>
@@ -492,15 +495,13 @@
                                     return rows;
                                 },
                                 // init table use data
-                                $table = $('#table-methods-table').bootstrapTable({
-                                    data: getRows()
-                                });
+                                $table = $('#table-methods-table').bootstrapTable();
 
                             $('#get-selections').click(function() {
                                 alert('Selected values: ' + JSON.stringify($table.bootstrapTable('getSelections')));
                             });
                             $('#load-data, #append-data, #check-all, #uncheck-all, ' +
-                                    '#show-loading, #hide-loading').click(function() {
+                                    '#show-loading, #hide-loading, #refresh').click(function() {
                                 $table.bootstrapTable($(this).data('method'), getRows());
                             });
                             $('#merge-cells').click(function() {

+ 2 - 0
docs/examples.js

@@ -1,4 +1,6 @@
 $(function() {
+    'use strict';
+
     $('.bs-example').each(function() {
         var source = $('<div></div>').text($(this).html()).html(),
             sources = source.split('\n'),