浏览代码

Update docs.

zhixin 11 年之前
父节点
当前提交
e8d16a1705
共有 3 个文件被更改,包括 19 次插入9 次删除
  1. 6 6
      docs/docs.js
  2. 3 3
      docs/documentation.html
  3. 10 0
      docs/examples.html

+ 6 - 6
docs/docs.js

@@ -98,6 +98,12 @@ $(function () {
                     'default': 'function(params) {<br>return {};<br>}'
                 },
                 {
+                    name: 'responseHandler',
+                    type: 'Function',
+                    description: 'Before load remote data, handler the response data format, the parameters object contains: <br>res: the response data.',
+                    'default': 'function(res) {<br>return res;<br>}'
+                },
+                {
                     name: 'pagination',
                     type: 'Boolean',
                     description: 'True to show a pagination toolbar on datagrid bottom.',
@@ -344,12 +350,6 @@ $(function () {
                     event: 'load-error.bs.table',
                     parameter: 'status',
                     description: 'Fires when some errors occur to load remote data.'
-                },
-                {
-                    name: 'onBeforeLoad',
-                    event: 'before-load.bs.table',
-                    parameter: 'res',
-                    description: 'Fires before a request is made to load data.'
                 }
             ],
             onClickRow: function (row) {

+ 3 - 3
docs/documentation.html

@@ -125,7 +125,8 @@
         method: 'get',
         url: undefined,
         contentType: 'application/json',
-        queryParams: function(params) {return {};}, // pageSize, pageNumber, searchText
+        queryParams: function(params) {return {};},
+        responseHandler: function(res) {return res;},
         pagination: false,
         sidePagination: 'client', // client or server
         totalRows: 0, // server side need to set
@@ -169,8 +170,7 @@
         onCheckAll: function() {return false;},
         onUncheckAll: function() {return false;},
         onLoadSuccess: function(data) {return false;},
-        onLoadError: function(status) {return false;},
-        onBeforeLoad: function(res) {return res;}
+        onLoadError: function(status) {return false;}
     });
 
     $.extend($.fn.bootstrapTable.columnDefaults, {

+ 10 - 0
docs/examples.html

@@ -109,6 +109,16 @@
                 <b>NOTE:</b> Bootstrap Table is licensed under the <a href="https://github.com/wenzhixin/bootstrap-table/blob/master/LICENSE">The MIT License</a>. Completely free, you can arbitrarily use and modify this plugin. If you like this plugin, you can <a href="http://github.com/wenzhixin/bootstrap-table"><b>Star</b></a> this repo, your support is my biggest motive force, thanks.
             </div>
             <div>
+                <div>
+                    <h2>Use API:</h2>
+                    <ul>
+                        <li><a href="data1.json">data1.json</a></li>
+                        <li><a href="data2.json">data2.json</a></li>
+                        <li><a href="data3.json">data3.json</a></li>
+                        <li><a href="data4.json">data4.json</a></li>
+                        <li><a href="/examples/bootstrap_table/data?offset=0&limit=10">/examples/bootstrap_table/data?offset=0&limit=10&search=test</a></li>
+                    </ul>
+                </div>
                 <div class="page-header">
                     <h1 id="basic-table">Basic Table</h1>
                 </div>