diff --git a/src/extensions/filter-control/utils.js b/src/extensions/filter-control/utils.js index 3c7469464a..12e289cb63 100644 --- a/src/extensions/filter-control/utils.js +++ b/src/extensions/filter-control/utils.js @@ -479,8 +479,12 @@ export function createControls (that, header) { } } } else if (value && value.length > 0 && value.trim()) { - $selectControl.find('option[selected]').removeAttr('selected') - $selectControl.find(`option[value="${value}"]`).attr('selected', true) + for (let i = 0; i < currentTarget.options.length; i++) { + currentTarget.options[i].seleted = false + if (currentTarget.options[i].value === value) { + currentTarget.options[i].seleted = true + } + } } else { $selectControl.find('option[selected]').removeAttr('selected') } diff --git a/src/extensions/sticky-header/bootstrap-table-sticky-header.js b/src/extensions/sticky-header/bootstrap-table-sticky-header.js index 3e05d5c811..f50f7c2476 100644 --- a/src/extensions/sticky-header/bootstrap-table-sticky-header.js +++ b/src/extensions/sticky-header/bootstrap-table-sticky-header.js @@ -100,9 +100,9 @@ $.BootstrapTable = class extends $.BootstrapTable { const top = $(window).scrollTop() // top anchor scroll position, minus header height - const start = this.$stickyBegin.offset().top - this.options.stickyHeaderOffsetY + const start = this.hasOwnProperty('$stickyBegin') ? this.$stickyBegin.offset().top - this.options.stickyHeaderOffsetY : 0 // bottom anchor scroll position, minus header height, minus sticky height - const end = this.$stickyEnd.offset().top - this.options.stickyHeaderOffsetY - this.$header.height() + const end = this.hasOwnProperty('$stickyEnd') ? this.$stickyEnd.offset().top - this.options.stickyHeaderOffsetY - this.$header.height() : 0 // show sticky when top anchor touches header, and when bottom anchor not exceeded if (top > start && top <= end) { @@ -144,7 +144,7 @@ $.BootstrapTable = class extends $.BootstrapTable { this.$stickyContainer.html(this.$stickyTable.append(this.$stickyHeader)) // match clone and source header positions when left-right scroll this.matchPositionX() - } else { + } else if (this.$stickyContainer !== undefined) { this.$stickyContainer.removeClass('fix-sticky').hide() } }