diff --git a/src/assets/plugins/bootstrap-table/js/bootstrap-table.js b/src/assets/plugins/bootstrap-table/js/bootstrap-table.js index 0a23530..eb8c8d4 100644 --- a/src/assets/plugins/bootstrap-table/js/bootstrap-table.js +++ b/src/assets/plugins/bootstrap-table/js/bootstrap-table.js @@ -2530,11 +2530,18 @@ }; BootstrapTable.prototype.destroy = function () { - // let bootstrapTable = $('div .bootstrap-table'); - // if (bootstrapTable.length > 1) { - // this.$container = $(bootstrapTable[0]); - // this.options.toolbar = $('div.fixed-table-toolbar > div.bars.pull-left').html(); - // } + let bootstrapTable = $('div .bootstrap-table'); + if (bootstrapTable) { + let $this = this; + let tables = bootstrapTable.filter(i => { + let $container = $(bootstrapTable[i]); + return ($container && $container.html().indexOf('"' +$this.$el[0].id + '"') != -1); + }); + if (tables.length > 1) { + this.$container = $(tables[0]); + this.options.toolbar = $('div.fixed-table-toolbar > div.bars.pull-left').html(); + } + } this.$el.insertBefore(this.$container); $(this.options.toolbar).insertBefore(this.$el); this.$container.next().remove(); @@ -2789,10 +2796,10 @@ throw new Error("Unknown method: " + option); } - // if (!data && option === 'destroy') { - // new BootstrapTable(this, options).destroy(); - // return; - // } + if (!data && option === 'destroy') { + new BootstrapTable(this, options).destroy(); + return; + } if (!data) { return;