修复bootstrap-table组件

This commit is contained in:
liaozetao
2023-11-12 14:30:14 +08:00
parent c9cbbff573
commit f9a28ae4c1

View File

@@ -2203,9 +2203,11 @@
fixedScroll = data.fixedScroll;
data = data[this.options.dataField];
} else if (!$.isArray(data)) { // support fixedScroll
if (data) {
fixedScroll = data.fixedScroll;
data = data.data;
}
}
this.initData(data);
this.initSearch();
@@ -2528,6 +2530,11 @@
};
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();
}
this.$el.insertBefore(this.$container);
$(this.options.toolbar).insertBefore(this.$el);
this.$container.next().remove();
@@ -2782,6 +2789,11 @@
throw new Error("Unknown method: " + option);
}
if (!data && option === 'destroy') {
new BootstrapTable(this, options).destroy();
return;
}
if (!data) {
return;
}