Browse Source

Fixed showCustomView option cannot work

zhixin 3 years ago
parent
commit
d5bca54d80

+ 1 - 1
.github/PULL_REQUEST_TEMPLATE.md

@@ -22,7 +22,7 @@
 
 **☑️Self Check before Merge**
 
-⚠️ Please check all items below before review. ⚠️
+⚠️ Please check all items below before reviewing. ⚠️
 
 - [ ] Doc is updated/provided or not needed
 - [ ] Demo is updated/provided or not needed

+ 6 - 0
CHANGELOG.md

@@ -1,6 +1,12 @@
 ChangeLog
 ---------
 
+### 1.21.2
+
+#### Extensions
+
+- **Update(custom-view):** Fixed `showCustomView` option cannot work.
+
 ### 1.21.1
 
 #### Core

+ 2 - 1
src/extensions/custom-view/bootstrap-table-custom-view.js

@@ -7,6 +7,7 @@ const Utils = $.fn.bootstrapTable.utils
 
 $.extend($.fn.bootstrapTable.defaults, {
   customView: false,
+  showCustomView: false,
   customViewDefaultView: false
 })
 
@@ -54,7 +55,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
   }
 
   initToolbar (...args) {
-    if (this.options.customView) {
+    if (this.options.customView && this.options.showCustomView) {
       this.buttons = Object.assign(this.buttons, {
         customView: {
           text: this.options.formatToggleCustomView(),