Browse Source

#131: update docs and examples.

zhixin 11 years ago
parent
commit
c2da378a75
3 changed files with 25 additions and 21 deletions
  1. 1 1
      README.md
  2. 7 19
      docs/docs.js
  3. 17 1
      docs/examples.html

+ 1 - 1
README.md

@@ -22,7 +22,7 @@ Bootstrap table displays data in a tabular format and offers rich support to rad
 
 
 - [x] Fix #119, #123: Save all `id` and `class` of `tr` and `td` for html table.
 - [x] Fix #119, #123: Save all `id` and `class` of `tr` and `td` for html table.
 - [x] Fix #149: Hide empty data on Card view.
 - [x] Fix #149: Hide empty data on Card view.
-- [ ] Fix #131: Add pagination events.
+- [x] Fix #131: Add pagination events.
 - [ ] Fix #144: `onCheck` and `onUncheck` method are reversed when using `clickToSelect` option. (jQuery 1.7.2 bug).
 - [ ] Fix #144: `onCheck` and `onUncheck` method are reversed when using `clickToSelect` option. (jQuery 1.7.2 bug).
 - [x] Apply `width` column option to row style.
 - [x] Apply `width` column option to row style.
 - [x] Add bootstrap-table-filter extension.
 - [x] Add bootstrap-table-filter extension.

+ 7 - 19
docs/docs.js

@@ -682,26 +682,14 @@ $(function () {
                     event: 'column-switch.bs.table',
                     event: 'column-switch.bs.table',
                     parameter: 'field, checked',
                     parameter: 'field, checked',
                     description: 'Fires when switch the column visible.'
                     description: 'Fires when switch the column visible.'
+                },
+                {
+                    name: 'onPageChange',
+                    event: 'page-change.bs.table',
+                    parameter: 'number, size',
+                    description: 'Fires when change the page number or page size.'
                 }
                 }
-            ],
-            onClickRow: function (row) {
-                console.log('onClickRow', row);
-            },
-            onSort: function (name, order) {
-                console.log('onSort', name, order);
-            },
-            onCheck: function(row) {
-                console.log('onCheck', row);
-            },
-            onUncheck: function(row) {
-                console.log('onUncheck', row);
-            },
-            onCheckAll: function() {
-                console.log('onCheckAll');
-            },
-            onUncheckAll: function() {
-                console.log('onUncheckAll');
-            }
+            ]
         });
         });
         $('#method').bootstrapTable({
         $('#method').bootstrapTable({
             cardView: cardView,
             cardView: cardView,

+ 17 - 1
docs/examples.html

@@ -801,9 +801,10 @@
                         Here is the result of event.
                         Here is the result of event.
                     </div>
                     </div>
                     <table id="events-table"
                     <table id="events-table"
-                           data-url="data1.json"
+                           data-url="data2.json"
                            data-height="299"
                            data-height="299"
                            data-search="true"
                            data-search="true"
+                           data-pagination="true"
                            data-show-columns="true">
                            data-show-columns="true">
                         <thead>
                         <thead>
                         <tr>
                         <tr>
@@ -847,8 +848,17 @@
                                     onUncheckAll: function () {
                                     onUncheckAll: function () {
                                         $result.text('Event: onUncheckAll');
                                         $result.text('Event: onUncheckAll');
                                     },
                                     },
+                                    onLoadSuccess: function (data) {
+                                        $result.text('Event: onLoadSuccess, data: ' + data);
+                                    },
+                                    onLoadError: function (status) {
+                                        $result.text('Event: onLoadError, data: ' + status);
+                                    },
                                     onColumnSwitch: function (field, checked) {
                                     onColumnSwitch: function (field, checked) {
                                         $result.text('Event: onSort, data: ' + field + ', ' + checked);
                                         $result.text('Event: onSort, data: ' + field + ', ' + checked);
+                                    },
+                                    onPageChange: function (number, size) {
+                                        $result.text('Event: onPageChange, data: ' + number + ', ' + size);
                                     }
                                     }
                                     */
                                     */
                                 }).on('all.bs.table', function (e, name, args) {
                                 }).on('all.bs.table', function (e, name, args) {
@@ -867,9 +877,15 @@
                                     $result.text('Event: check-all.bs.table');
                                     $result.text('Event: check-all.bs.table');
                                 }).on('uncheck-all.bs.table', function (e) {
                                 }).on('uncheck-all.bs.table', function (e) {
                                     $result.text('Event: uncheck-all.bs.table');
                                     $result.text('Event: uncheck-all.bs.table');
+                                }).on('load-success.bs.table', function (e, data) {
+                                    $result.text('Event: load-success.bs.table');
+                                }).on('load-error.bs.table', function (e, status) {
+                                    $result.text('Event: load-error.bs.table, data: ' + status);
                                 }).on('column-switch.bs.table', function (e, field, checked) {
                                 }).on('column-switch.bs.table', function (e, field, checked) {
                                     $result.text('Event: column-switch.bs.table, data: ' +
                                     $result.text('Event: column-switch.bs.table, data: ' +
                                         field + ', ' + checked);
                                         field + ', ' + checked);
+                                }).on('page-change.bs.table', function (e, size, number) {
+                                    $result.text('Event: page-change.bs.table, data: ' + number + ', ' + size);
                                 });
                                 });
                             });
                             });
                         });
                         });