ソースを参照

Merge branch 'develop' into keep-details-open

Dennis Hernández 5 年 前
コミット
4d4d22220d

+ 4 - 1
src/bootstrap-table.js

@@ -252,7 +252,10 @@ class BootstrapTable {
       let detailViewTemplate = ''
 
       if (i === 0 && Utils.hasDetailViewIcon(this.options)) {
-        detailViewTemplate = `<th class="detail" rowspan="${this.options.columns.length}">
+        const rowspan = this.options.columns.length > 1 ?
+          ` rowspan="${this.options.columns.length}"` : ''
+
+        detailViewTemplate = `<th class="detail"${rowspan}>
           <div class="fht-cell"></div>
           </th>`
       }

+ 9 - 1
src/extensions/cookie/bootstrap-table-cookie.js

@@ -138,7 +138,8 @@ const UtilsCookie = {
           encodeURIComponent(cookieName), '=',
           '; expires=Thu, 01 Jan 1970 00:00:00 GMT',
           that.options.cookiePath ? `; path=${that.options.cookiePath}` : '',
-          that.options.cookieDomain ? `; domain=${that.options.cookieDomain}` : ''
+          that.options.cookieDomain ? `; domain=${that.options.cookieDomain}` : '',
+          `;SameSite=${ that.options.cookieSameSite}`
         ].join('')
         break
       case 'localStorage':
@@ -374,6 +375,13 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
   onSort (...args) {
     super.onSort(...args)
+
+    if (this.options.sortName === undefined || this.options.sortOrder === undefined) {
+      UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortName)
+      UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortOrder)
+      return
+    }
+
     UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder)
     UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName)
   }

+ 6 - 0
src/extensions/export/bootstrap-table-export.js

@@ -196,6 +196,12 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
       const data = this.getData()
 
+      if (o.detailView && o.detailViewIcon) {
+        const detailViewIndex = o.detailViewAlign === 'left' ? 0 : this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options)
+
+        o.exportOptions.ignoreColumn = [detailViewIndex].concat(o.exportOptions.ignoreColumn || [])
+      }
+
       if (o.exportFooter) {
         const $footerRow = this.$tableFooter.find('tr').first()
         const footerData = {}