ソースを参照

Update docs and Changelog.

zhixin 10 年 前
コミット
53f1d24506

+ 12 - 0
CHANGELOG.md

@@ -1,5 +1,17 @@
 ## ChangeLog
 ## ChangeLog
 
 
+### 1.8.2
+
+- [enh] Update bootstrap-table-cookie.js.
+- [enh] Use options for detailView's open/close icons.
+- [enh] Added `refreshOptions` and `gtHiddenColumns` method.
+- [enh] Added `datepicker` option to Filter Control.
+- [bug] Fix #936 Sort carets shouldn't be inline-styled by JS.
+- [bug] Fix table header width bug when setting table to no bordered.
+- [bug] Fix #938, fix #940: Multiple Sort and Hide/Show column.
+- [bug] Fix #970: click and dblclick bug on no-rows table.
+- [bug] Fix #967: unselected column while column sorted display error.
+
 ### 1.8.1
 ### 1.8.1
 
 
 - [enh] Accessing field name in formatter.
 - [enh] Accessing field name in formatter.

+ 23 - 5
docs/_i18n/en/extensions/cookie.md

@@ -10,23 +10,41 @@ Use Plugin: [bootstrap-table-cookie](https://github.com/wenzhixin/bootstrap-tabl
 
 
 ## Options
 ## Options
 
 
-### stateSave
+### cookie
 
 
 * type: Boolean
 * type: Boolean
 * description: Set true to save the state of a table (its paging position, ordering state, records per page).
 * description: Set true to save the state of a table (its paging position, ordering state, records per page).
 * default: `false`
 * default: `false`
 
 
-### stateSaveExpire
+### cookieExpire
 
 
 * type: String
 * type: String
-* description: You must set this property if stateSave is enable to know when will expire the cookie created. Must use this format: 'number{letter}' like '2h', in the letter position
+* description: You must set this property if cookie option is enable to know when will expire the cookie created. Must use this format: 'number{letter}' like '2h', in the letter position
                		you can use: 's','mi','h','d','m','y', these means: 'seconds', 'minutes', 'hours', 'days', 'months', 'years'.
                		you can use: 's','mi','h','d','m','y', these means: 'seconds', 'minutes', 'hours', 'days', 'months', 'years'.
 * default: `2h`
 * default: `2h`
 
 
-### stateSaveIdTable
+### cookiePath
 
 
 * type: String
 * type: String
-* description: You must set this property if stateSave is enable to sets an unique cookie with an identifier for each table in your page or project. You must set this property because we need create cookies with an identifier.
+* description: you can tell the browser what path the cookie belongs to. By default, the cookie belongs to the current page.
+* default: `null`
+
+### cookieDomain
+
+* type: String
+* description: This is the website domain, with the www. prefix removed.
+* default: `null`
+
+### cookieSecure
+
+* type: Boolean
+* description: This property keeps cookie communication limited to encrypted transmission, directing browsers to use cookies only via secure/encrypted connections.
+* default: `null`
+
+### cookieIdTable
+
+* type: String
+* description: You must set this property if the cookie property is enabled to set an unique cookie with an identifier for each table in your page or project. You must set this property because we need create cookies with an identifier.
 * default: ``
 * default: ``
 
 
 ## This plugin saves
 ## This plugin saves

+ 2 - 2
docs/_i18n/en/extensions/filter-control.md

@@ -1,6 +1,6 @@
 # Table Filter Control
 # Table Filter Control
 
 
-Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control)
+Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control) </br>
 Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 
 
 ## Usage
 ## Usage
@@ -22,7 +22,7 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 ### filterControl
 ### filterControl
 
 
 * type: String
 * type: String
-* description: Set `input`: show an input control, `select`: show a select control, 'datepicker': show a datepicker control.
+* description: Set `input`: show an input control, `select`: show a select control, `datepicker`: show a datepicker control.
 * default: `undefined`
 * default: `undefined`
 
 
 ### filterDatepickerOptions
 ### filterDatepickerOptions

+ 6 - 0
docs/_i18n/en/extensions/flat-json.md

@@ -15,3 +15,9 @@ Use Plugin: [bootstrap-table-flat-json](https://github.com/djhvscf/bootstrap-tab
 * type: Boolean
 * type: Boolean
 * description: Set true to flat the JSON object.
 * description: Set true to flat the JSON object.
 * default: `false`
 * default: `false`
+
+### flatSeparator
+
+* type: String
+* description: Set the default separator between object levels.
+* default: `.`

+ 23 - 5
docs/_i18n/es/extensions/cookie.md

@@ -10,23 +10,41 @@ Use Plugin: [bootstrap-table-cookie](https://github.com/wenzhixin/bootstrap-tabl
 
 
 ## Options
 ## Options
 
 
-### stateSave
+### cookie
 
 
 * type: Boolean
 * type: Boolean
 * description: Set true to save the state of a table (its paging position, ordering state, records per page).
 * description: Set true to save the state of a table (its paging position, ordering state, records per page).
 * default: `false`
 * default: `false`
 
 
-### stateSaveExpire
+### cookieExpire
 
 
 * type: String
 * type: String
-* description: You must set this property if stateSave is enable to know when will expire the cookie created. Must use this format: 'number{letter}' like '2h', in the letter position
+* description: You must set this property if cookie option is enable to know when will expire the cookie created. Must use this format: 'number{letter}' like '2h', in the letter position
                		you can use: 's','mi','h','d','m','y', these means: 'seconds', 'minutes', 'hours', 'days', 'months', 'years'.
                		you can use: 's','mi','h','d','m','y', these means: 'seconds', 'minutes', 'hours', 'days', 'months', 'years'.
 * default: `2h`
 * default: `2h`
 
 
-### stateSaveIdTable
+### cookiePath
 
 
 * type: String
 * type: String
-* description: You must set this property if stateSave is enable to sets an unique cookie with an identifier for each table in your page or project. You must set this property because we need create cookies with an identifier.
+* description: you can tell the browser what path the cookie belongs to. By default, the cookie belongs to the current page.
+* default: `null`
+
+### cookieDomain
+
+* type: String
+* description: This is the website domain, with the www. prefix removed.
+* default: `null`
+
+### cookieSecure
+
+* type: Boolean
+* description: This property keeps cookie communication limited to encrypted transmission, directing browsers to use cookies only via secure/encrypted connections.
+* default: `null`
+
+### cookieIdTable
+
+* type: String
+* description: You must set this property if the cookie property is enabled to set an unique cookie with an identifier for each table in your page or project. You must set this property because we need create cookies with an identifier.
 * default: ``
 * default: ``
 
 
 ## This plugin saves
 ## This plugin saves

+ 2 - 2
docs/_i18n/es/extensions/filter-control.md

@@ -1,6 +1,6 @@
 # Table Filter Control
 # Table Filter Control
 
 
-Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control)
+Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control) </br>
 Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 
 
 ## Usage
 ## Usage
@@ -22,7 +22,7 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 ### filterControl
 ### filterControl
 
 
 * type: String
 * type: String
-* description: Set `input`: show an input control, `select`: show a select control, 'datepicker': show a datepicker control.
+* description: Set `input`: show an input control, `select`: show a select control, `datepicker`: show a datepicker control.
 * default: `undefined`
 * default: `undefined`
 
 
 ### filterDatepickerOptions
 ### filterDatepickerOptions

+ 6 - 0
docs/_i18n/es/extensions/flat-json.md

@@ -15,3 +15,9 @@ Use Plugin: [bootstrap-table-flat-json](https://github.com/djhvscf/bootstrap-tab
 * type: Boolean
 * type: Boolean
 * description: Set true to flat the JSON object.
 * description: Set true to flat the JSON object.
 * default: `false`
 * default: `false`
+
+### flatSeparator
+
+* type: String
+* description: Set the default separator between object levels.
+* default: `.`

+ 23 - 5
docs/_i18n/zh-cn/extensions/cookie.md

@@ -10,23 +10,41 @@ Use Plugin: [bootstrap-table-cookie](https://github.com/wenzhixin/bootstrap-tabl
 
 
 ## Options
 ## Options
 
 
-### stateSave
+### cookie
 
 
 * type: Boolean
 * type: Boolean
 * description: Set true to save the state of a table (its paging position, ordering state, records per page).
 * description: Set true to save the state of a table (its paging position, ordering state, records per page).
 * default: `false`
 * default: `false`
 
 
-### stateSaveExpire
+### cookieExpire
 
 
 * type: String
 * type: String
-* description: You must set this property if stateSave is enable to know when will expire the cookie created. Must use this format: 'number{letter}' like '2h', in the letter position
+* description: You must set this property if cookie option is enable to know when will expire the cookie created. Must use this format: 'number{letter}' like '2h', in the letter position
                		you can use: 's','mi','h','d','m','y', these means: 'seconds', 'minutes', 'hours', 'days', 'months', 'years'.
                		you can use: 's','mi','h','d','m','y', these means: 'seconds', 'minutes', 'hours', 'days', 'months', 'years'.
 * default: `2h`
 * default: `2h`
 
 
-### stateSaveIdTable
+### cookiePath
 
 
 * type: String
 * type: String
-* description: You must set this property if stateSave is enable to sets an unique cookie with an identifier for each table in your page or project. You must set this property because we need create cookies with an identifier.
+* description: you can tell the browser what path the cookie belongs to. By default, the cookie belongs to the current page.
+* default: `null`
+
+### cookieDomain
+
+* type: String
+* description: This is the website domain, with the www. prefix removed.
+* default: `null`
+
+### cookieSecure
+
+* type: Boolean
+* description: This property keeps cookie communication limited to encrypted transmission, directing browsers to use cookies only via secure/encrypted connections.
+* default: `null`
+
+### cookieIdTable
+
+* type: String
+* description: You must set this property if the cookie property is enabled to set an unique cookie with an identifier for each table in your page or project. You must set this property because we need create cookies with an identifier.
 * default: ``
 * default: ``
 
 
 ## This plugin saves
 ## This plugin saves

+ 2 - 2
docs/_i18n/zh-cn/extensions/filter-control.md

@@ -1,6 +1,6 @@
 # Table Filter Control
 # Table Filter Control
 
 
-Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control)
+Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control) </br>
 Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 
 
 ## Usage
 ## Usage
@@ -22,7 +22,7 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 ### filterControl
 ### filterControl
 
 
 * type: String
 * type: String
-* description: Set `input`: show an input control, `select`: show a select control, 'datepicker': show a datepicker control.
+* description: Set `input`: show an input control, `select`: show a select control, `datepicker`: show a datepicker control.
 * default: `undefined`
 * default: `undefined`
 
 
 ### filterDatepickerOptions
 ### filterDatepickerOptions

+ 6 - 0
docs/_i18n/zh-cn/extensions/flat-json.md

@@ -15,3 +15,9 @@ Use Plugin: [bootstrap-table-flat-json](https://github.com/djhvscf/bootstrap-tab
 * type: Boolean
 * type: Boolean
 * description: Set true to flat the JSON object.
 * description: Set true to flat the JSON object.
 * default: `false`
 * default: `false`
+
+### flatSeparator
+
+* type: String
+* description: Set the default separator between object levels.
+* default: `.`

+ 11 - 6
src/bootstrap-table.js

@@ -1055,10 +1055,11 @@
                 this.options.pageSize = this.options.totalRows;
                 this.options.pageSize = this.options.totalRows;
                 $allSelected = true;
                 $allSelected = true;
             } else if (this.options.pageSize === this.options.totalRows) {
             } else if (this.options.pageSize === this.options.totalRows) {
-                // Fix #667 Table with pagination, multiple pages and a search that matches to one page throws exception
+                // Fix #667 Table with pagination,
+                // multiple pages and a search that matches to one page throws exception
                 var pageLst = typeof this.options.pageList === 'string' ?
                 var pageLst = typeof this.options.pageList === 'string' ?
-                    this.options.pageList.replace('[', '').replace(']', '').replace(/ /g, '').toLowerCase().split(',') :
-                    this.options.pageList;
+                    this.options.pageList.replace('[', '').replace(']', '')
+                        .replace(/ /g, '').toLowerCase().split(',') : this.options.pageList;
                 if (pageLst.indexOf(this.options.formatAllRows().toLowerCase()) > -1) {
                 if (pageLst.indexOf(this.options.formatAllRows().toLowerCase()) > -1) {
                     $allSelected = true;
                     $allSelected = true;
                 }
                 }
@@ -1087,9 +1088,12 @@
         html.push('<span class="page-list">');
         html.push('<span class="page-list">');
 
 
         var pageNumber = [
         var pageNumber = [
-                sprintf('<span class="btn-group %s">', this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
+                sprintf('<span class="btn-group %s">',
+                    this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
                     'dropdown' : 'dropup'),
                     'dropdown' : 'dropup'),
-                '<button type="button" class="btn btn-default ' + (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) + ' dropdown-toggle" data-toggle="dropdown">',
+                '<button type="button" class="btn btn-default ' +
+                    (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) +
+                    ' dropdown-toggle" data-toggle="dropdown">',
                 '<span class="page-size">',
                 '<span class="page-size">',
                 $allSelected ? this.options.formatAllRows() : this.options.pageSize,
                 $allSelected ? this.options.formatAllRows() : this.options.pageSize,
                 '</span>',
                 '</span>',
@@ -1100,7 +1104,8 @@
             pageList = this.options.pageList;
             pageList = this.options.pageList;
 
 
         if (typeof this.options.pageList === 'string') {
         if (typeof this.options.pageList === 'string') {
-            var list = this.options.pageList.replace('[', '').replace(']', '').replace(/ /g, '').split(',');
+            var list = this.options.pageList.replace('[', '').replace(']', '')
+                .replace(/ /g, '').split(',');
 
 
             pageList = [];
             pageList = [];
             $.each(list, function (i, value) {
             $.each(list, function (i, value) {