ソースを参照

Merge branch 'feature/multiselect-filtercontrol' of https://github.com/wenzhixin/bootstrap-table into feature/multiselect-filtercontrol

djhvscf 4 年 前
コミット
2c940cc6ab

+ 3 - 5
src/extensions/cookie/bootstrap-table-cookie.js

@@ -458,16 +458,14 @@ $.BootstrapTable = class extends $.BootstrapTable {
       throw new Error('Could not parse the json of the sortPriority cookie!', sortPriorityCookie)
     }
 
-    // sortOrder
-    this.options.sortOrder = undefined
-    // sortName
-    this.options.sortName = undefined
-
     if (!sortPriorityCookie) {
       // sortOrder
       this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder
       // sortName
       this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName
+    } else {
+      this.options.sortOrder = undefined
+      this.options.sortName = undefined
     }
 
     // sortPriority

+ 1 - 1
src/extensions/export/bootstrap-table-export.js

@@ -152,7 +152,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
     let $exportButtons = this.$export.find('[data-type]')
 
     if (exportTypes.length === 1) {
-      $exportButtons = this.$export.find('button')
+      $exportButtons = this.$export
     }
 
     $exportButtons.click(e => {

+ 4 - 1
src/extensions/print/bootstrap-table-print.js

@@ -74,6 +74,7 @@ $.extend($.fn.bootstrapTable.COLUMN_DEFAULTS, {
 $.extend($.fn.bootstrapTable.defaults.icons, {
   print: {
     bootstrap3: 'glyphicon-print icon-share',
+    bootstrap5: 'bi-printer',
     'bootstrap-table': 'icon-printer'
   }[$.fn.bootstrapTable.theme] || 'fa-print'
 })
@@ -276,7 +277,9 @@ $.BootstrapTable = class extends $.BootstrapTable {
     const table = buildTable(data, this.options.columns)
     const newWin = window.open('')
 
-    newWin.document.write(this.options.printPageBuilder.call(this, table))
+    const calculatedPrintPage = Utils.calculateObjectValue(this, this.options.printPageBuilder, [table], printPageBuilderDefault(table))
+
+    newWin.document.write(calculatedPrintPage)
     newWin.document.close()
     newWin.focus()
     newWin.print()